camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Soto <alex.s...@envieta.com>
Subject Re: Accessing the HTTP Response Code with netty4
Date Mon, 11 Apr 2016 13:44:21 GMT
It was my fault,  I had a custom Trace Formatter that was printing null mistakenly. 
 
Best regards,
Alex soto



> On Apr 9, 2016, at 3:11 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> 
> 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