You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Viktoras <v....@gmail.com> on 2012/11/05 16:58:34 UTC
Headers get lost (Jetty -> NMR -> CXF)
Hi,
I have a simple CXF endpoint exposed through NMR. The entry to CXF is
through Jetty.
The route START sets the header XXX and directs to NMR. After that CXF route
takes over, but here the header is lost. Please see the Camel context below:
The log output is (CXF route has lost XXX header):
But if I change *nmr:gogogo* with HTTP, e.g.:
http://localhost:7070/helloWorld, both routes print the header as expected:
What can I do for headers to persist during the first example?
--
View this message in context: http://camel.465427.n5.nabble.com/Headers-get-lost-Jetty-NMR-CXF-tp5722158.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Headers get lost (Jetty -> NMR -> CXF)
Posted by Viktoras <v....@gmail.com>.
Great, thanks Willem!
--
View this message in context: http://camel.465427.n5.nabble.com/Headers-get-lost-Jetty-NMR-CXF-tp5722158p5722281.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Headers get lost (Jetty -> NMR -> CXF)
Posted by Willem jiang <wi...@gmail.com>.
Hi Viktoras,
Yeah, it is a bug. I just filled a JIRA[1] in servicemix for it.
[1]https://issues.apache.org/jira/browse/SMX4-1273
--
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.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: willemjiang
On Wednesday, November 7, 2012 at 5:20 AM, Viktoras wrote:
> Hi Willem,
>
> Thanks, your proposed solution works.
>
> But I've been wondering, isn't it a bug which should be fixed? E.g.
> transition NMR -> NMR keeps all the headers, but CXF -> NMR looses them (ok,
> not exacly loses, as they are accessible through CamelCxfMessage
> (SoapMessage)). It feels unnatural and the behaviour is not uniform.
>
> Cheers,
> Viktoras
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Headers-get-lost-Jetty-NMR-CXF-tp5722158p5722257.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Headers get lost (Jetty -> NMR -> CXF)
Posted by Viktoras <v....@gmail.com>.
Hi Willem,
Thanks, your proposed solution works.
But I've been wondering, isn't it a bug which should be fixed? E.g.
transition NMR -> NMR keeps all the headers, but CXF -> NMR looses them (ok,
not exacly loses, as they are accessible through CamelCxfMessage
(SoapMessage)). It feels unnatural and the behaviour is not uniform.
Cheers,
Viktoras
--
View this message in context: http://camel.465427.n5.nabble.com/Headers-get-lost-Jetty-NMR-CXF-tp5722158p5722257.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Headers get lost (Jetty -> NMR -> CXF)
Posted by Willem jiang <wi...@gmail.com>.
Hi Viktoras,
I just checked to code of camel-service which implements the nmr component.
As the nmr component doesn't have the concept of protocol header which will be put into the camel message header by default.
That could explain why you don't see the header when you use the
You should be able to find the header by reference the cxf message from camel message like this
Message cxfMessage = camelMessage.getHeader("CamelCxfMessage");
String value = cxfMessage.get("XXX");
--
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.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: willemjiang
On Tuesday, November 6, 2012 at 2:10 PM, Viktoras wrote:
> Hi Willem,
>
> Thanks for reply; the header is named XXX and doesn't end in CXF.
>
> The weird part is that the header is filtered when CXF component address is
> NMR (actually ALL headers disappear in this case). If the address is changed
> to HTTP, everything works as expected. Can you please check the code snippet
> again?
>
> Thanks,
> Viktoras
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Headers-get-lost-Jetty-NMR-CXF-tp5722158p5722191.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Headers get lost (Jetty -> NMR -> CXF)
Posted by Viktoras <v....@gmail.com>.
Hi Willem,
Thanks for reply; the header is named XXX and doesn't end in CXF.
The weird part is that the header is filtered when CXF component address is
NMR (actually ALL headers disappear in this case). If the address is changed
to HTTP, everything works as expected. Can you please check the code snippet
again?
Thanks,
Viktoras
--
View this message in context: http://camel.465427.n5.nabble.com/Headers-get-lost-Jetty-NMR-CXF-tp5722158p5722191.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Headers get lost (Jetty -> NMR -> CXF)
Posted by Willem jiang <wi...@gmail.com>.
Hi,
Can you change the header name not end with CXF?
It looks like camel-cxf just filters the header which contains CXF.
--
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.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: willemjiang
On Monday, November 5, 2012 at 11:58 PM, Viktoras wrote:
> Hi,
>
> I have a simple CXF endpoint exposed through NMR. The entry to CXF is
> through Jetty.
> The route START sets the header XXX and directs to NMR. After that CXF route
> takes over, but here the header is lost. Please see the Camel context below:
>
>
>
> The log output is (CXF route has lost XXX header):
>
>
> But if I change *nmr:gogogo* with HTTP, e.g.:
> http://localhost:7070/helloWorld, both routes print the header as expected:
>
>
> What can I do for headers to persist during the first example?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Headers-get-lost-Jetty-NMR-CXF-tp5722158.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).