2014-04-23 5 views
1

HTTP 아웃 바운드 끝점을 호출하는 흐름에 http 호출을하고 있습니다. 아웃 바운드 끝점은 http.status = 400이라는 메시지를 반환합니다. 내가 흐름에있는 마지막 순간까지 헤더는 http.status이 실제로 400이라는 것을 보여줄 것입니다.Mule은 400 대신 500을 반환합니다.

그러나 Mule은 http.status = 500 Internal Server Error 대신 메시지를 반환합니다.

나는이 솔루션을 발견,하지만 나를 위해 작동하지 않습니다 https://stackoverflow.com/a/16486259/3510748

<set-variable variableName="http.disable.status.code.exception.check" 
      value="true" /> 

나도 정확하지 않은 (200)로 변경됩니다 내 HTTP 아웃 바운드 엔드 포인트 http.status 전에이 설정합니다.

올바른 http.status를 받으려면 어떻게해야합니까?

답변

1

당신은 아웃 바운드 속성으로 HTTP 헤더를 설정할 수 있습니다, 그래서 당신은 동일한 상태로 응답하는 아웃 바운드 HTTP 호출 후에

<set-property propertyName="http.status" value="#[message.inboundProperties['http.status']]"/> 

처럼 뭔가를 할 수 있어야합니다. 다른 유형의 예외 처리가없는 한 예외를 방지하려면 http.disable.status.code.exception.check도 필요합니다.

+0

감사합니다. Anton! 'http.disable.status.code.exception.check'과'http.status'를'outboundproperty'로 합치면 속임수를 쓰게됩니다! –

관련 문제