Content based router

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Content based router

Erik Allais
Hi, im new with the eip
i read in the eip book that

"A key property of the Message Router (content based router) is that it does not modify the message contents. It only concerns itself with the destination of the message."

I wonder if there is a pattern which route and change the message content at the same time.
I wont avoid to use a Message translator after the router.

Regards,
Erik
Reply | Threaded
Open this post in threaded view
|

Re: Content based router

jstrachan
On 8/10/07, Erik Allais <[hidden email]> wrote:

>
> Hi, im new with the eip
> i read in the eip book that
>
> "A key property of the Message Router (content based router) is that it does
> not modify the message contents. It only concerns itself with the
> destination of the message."
>
> I wonder if there is a pattern which route and change the message content at
> the same time.
> I wont avoid to use a Message translator after the router.

You can mix and match patterns together to make a composite router
which includes multiple EIP patterns; so there's nothing stopping you
using a Message Translator (or indeed any Camel Processor or bean)
within a content based router.

http://activemq.apache.org/camel/processor.html
http://activemq.apache.org/camel/bean-integration.html


--
James
-------
http://macstrac.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Content based router

Erik Allais
How can i create this composite router? with the processor?

James.Strachan wrote
On 8/10/07, Erik Allais <erik.allais@altervisions.com> wrote:
>
> Hi, im new with the eip
> i read in the eip book that
>
> "A key property of the Message Router (content based router) is that it does
> not modify the message contents. It only concerns itself with the
> destination of the message."
>
> I wonder if there is a pattern which route and change the message content at
> the same time.
> I wont avoid to use a Message translator after the router.

You can mix and match patterns together to make a composite router
which includes multiple EIP patterns; so there's nothing stopping you
using a Message Translator (or indeed any Camel Processor or bean)
within a content based router.

http://activemq.apache.org/camel/processor.html
http://activemq.apache.org/camel/bean-integration.html


--
James
-------
http://macstrac.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Content based router

jstrachan
On 8/10/07, Erik Allais <[hidden email]> wrote:
>
> How can i create this composite router? with the processor?

Yeah...

from("foo").choice().
  when(xpath("/foo/bar")).process(someProcesor).to("seda:a")
  otherwise().to("seda:b");

notice how we can mix and match arbitrary processors or endpoints
inside the route.
--
James
-------
http://macstrac.blogspot.com/