You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by clement tamisier <cl...@gmail.com> on 2013/05/17 10:06:15 UTC

route, http code

Hi,

If I define a route like this:

from("<MyUrl>/test")
.setHeader(Exchange.HTTP_RESPONSE_CODE, simple("400"));
my http client get a 200 response code.

If a add something else on the route like:
from("<MyUrl>/test")
.setHeader(Exchange.HTTP_RESPONSE_CODE, simple("400"))
.log("400").

my http client get a 400 response code as expected.

Is there something i do wrong.
BR





--
View this message in context: http://camel.465427.n5.nabble.com/route-http-code-tp5732728.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: route, http code

Posted by clement tamisier <cl...@gmail.com>.
Do you want me to create an issue in JIRA ?



--
View this message in context: http://camel.465427.n5.nabble.com/route-http-code-tp5732728p5732731.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: route, http code

Posted by Willem jiang <wi...@gmail.com>.
It looks like the header just set to the in message, we should let Camel check the header in the in message first.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Friday, May 17, 2013 at 4:06 PM, clement tamisier wrote:

> Hi,
>  
> If I define a route like this:
>  
> from("<MyUrl>/test")
> .setHeader(Exchange.HTTP_RESPONSE_CODE, simple("400"));
> my http client get a 200 response code.
>  
> If a add something else on the route like:
> from("<MyUrl>/test")
> .setHeader(Exchange.HTTP_RESPONSE_CODE, simple("400"))
> .log("400").
>  
> my http client get a 400 response code as expected.
>  
> Is there something i do wrong.
> BR
>  
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/route-http-code-tp5732728.html
> Sent from the Camel Development mailing list archive at Nabble.com (http://Nabble.com).




Re: route, http code

Posted by clement tamisier <cl...@gmail.com>.
https://issues.apache.org/jira/browse/CAMEL-6375



--
View this message in context: http://camel.465427.n5.nabble.com/route-http-code-tp5732728p5732734.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: route, http code

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can use setOutHeader

But yeah I think setHeader should support both situations (with and
without the log).
Feel free to log a JIRA ticket.



On Fri, May 17, 2013 at 10:06 AM, clement tamisier
<cl...@gmail.com> wrote:
> Hi,
>
> If I define a route like this:
>
> from("<MyUrl>/test")
> .setHeader(Exchange.HTTP_RESPONSE_CODE, simple("400"));
> my http client get a 200 response code.
>
> If a add something else on the route like:
> from("<MyUrl>/test")
> .setHeader(Exchange.HTTP_RESPONSE_CODE, simple("400"))
> .log("400").
>
> my http client get a 400 response code as expected.
>
> Is there something i do wrong.
> BR
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/route-http-code-tp5732728.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen