I'm using a route that is requesting a resource over HTTP using the https4 component (camel version 2.14.0). A dead letter channel handles errors by routing failed exchanges to the log endpoint like so:
.to("log:backendFailed?level=WARN&showAll=true")
In case of a gateway timeout (504) a HttpOperationFailedException
indicating the error is thrown and the exchange is logged as expected. Since i set showAll=true
, all headers of the exchange are logged, including CamelHttpResponseCode
. The log looks like this:
CamelFailureEndpoint=https4://backend?httpClient.socketTimeout=70000&httpClient.connectTimeout=70000,
...
CamelToEndpoint=log://backendFailed?level=WARN&showAll=true
...
CamelHttpResponseCode=200,
CamelHttpUri=https://example.com/myresource,
...
CaughtExceptionType: org.apache.camel.component.http4.HttpOperationFailedException,
CaughtExceptionMessage: HTTP operation failed invoking https://example.com/myresource with statusCode: 504, StackTrace: org.apache.camel.component.http4.HttpOperationFailedException: HTTP operation failed invoking https://example.com/myresource with statusCode: 504
Shouldn't the CamelHttpResponseCode
header say 504 here?