camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Accessing the HTTP Response Code with netty4
Date Sat, 09 Apr 2016 07:11:20 GMT
That would be a bit odd as this is the code that maps the netty status to Camel

headers.put(Exchange.HTTP_RESPONSE_CODE, response.getStatus().code());
headers.put(Exchange.HTTP_RESPONSE_TEXT, response.getStatus().reasonPhrase());

Have you turned off mapHeaders by any chance?



On Fri, Apr 8, 2016 at 4:39 PM, Alex Soto <alex.soto@envieta.com> wrote:
> Hello:
>
> I am using Camel 2.16.2  and I have a route with a Netty4 HTTP producer calling a remote
HTTP server.  I am passing the option throwExceptionOnFailure=false.  Upon return,  I need
to check the HTTP response code like this:
>
> <filter>
>         <simple>${header.CamelHttpResponseCode} == 403</simple>
>
>         . . .
> </filter>
>
>
> The problem is that the CamelHttpResponseCode is always null. I can see it the trace
logs:
>
> Headers:{CamelHttpResponseCode=null, Connection=keep-alive, CamelHttpResponseText=Not
Modified, Content-Length=0}
>
>
> How can I check the HTTP response code?
>
>
> Best regards,
> Alex soto
>
>
>
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message