You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sebastian Gomez <sa...@gmail.com> on 2010/01/12 22:38:14 UTC

How to pass headers from Camel to JBI and back

Hi everyone,

I've upgraded from Camel 1.6 to 2.1 and I've run into the issue of losing
Camel headers when calling a JBI endpoint. I think the way to go is to
declare a FilterHeaderStrategy. I've seen some examples, but I don't know
how to integrate it into my camel routes.

First of all I've got to declare my CamelContext in an XML file (all
examples I've seen are creating the camel context programatically). How do I
declare the FilterHeaderStrategy there? Just as a simple bean?

Secondly, when I call the JBI endpoint, I should append #myFilterStrategy to
the URI. Will this map the name of myFilterStrategy to the id of the bean
declared in the context?

I've tried this, but it doesn't work, so I guess it will be a bit more
complicated than I thought.

Hope someone can help me out here. Thanks in advance.

Sebastian Gomez.

Re: How to pass headers from Camel to JBI and back

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 12, 2010 at 10:38 PM, Sebastian Gomez <sa...@gmail.com> wrote:
> Hi everyone,
>
> I've upgraded from Camel 1.6 to 2.1 and I've run into the issue of losing
> Camel headers when calling a JBI endpoint. I think the way to go is to
> declare a FilterHeaderStrategy. I've seen some examples, but I don't know
> how to integrate it into my camel routes.
>
> First of all I've got to declare my CamelContext in an XML file (all
> examples I've seen are creating the camel context programatically). How do I
> declare the FilterHeaderStrategy there? Just as a simple bean?
>
> Secondly, when I call the JBI endpoint, I should append #myFilterStrategy to
> the URI. Will this map the name of myFilterStrategy to the id of the bean
> declared in the context?
>
> I've tried this, but it doesn't work, so I guess it will be a bit more
> complicated than I thought.
>
> Hope someone can help me out here. Thanks in advance.
>
> Sebastian Gomez.
>

Did you upgrade SMX in the same time?

I believe SMX and Camel is separated a bit more than before. The
JbiExchange did not fare well when it was routed in Camel as the JBI
spec. does not like concurrent access to it and whatnot. It just
complicated things much more. So the servicemix-camel component now
calls Camel and does a copy/restore kinda approaches to load and
offload the data from/to Camel.

Gert V. from the SMX teams knows much more about this and the reasons etc.



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus