Change Message Destination using Interceptors

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

Change Message Destination using Interceptors

drp
How can I change the destination queue of a message using Interceptors?
Reply | Threaded
Open this post in threaded view
|

Re: Change Message Destination using Interceptors

James Strachan-2
2009/3/17 DanielR <[hidden email]>:
>
> How can I change the destination queue of a message using Interceptors?

Whats your use case BTW?

The easiest thing might be to use a CamelDestination which can then
use a route client side to perform content based routing etc.

--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/
drp
Reply | Threaded
Open this post in threaded view
|

Re: Change Message Destination using Interceptors

drp

I need to forward the messsage to the proper queue depending on the first 10 characters of the body of the message.

James.Strachan wrote
2009/3/17 DanielR <romero.cl@gmail.com>:
>
> How can I change the destination queue of a message using Interceptors?

Whats your use case BTW?

The easiest thing might be to use a CamelDestination which can then
use a route client side to perform content based routing etc.

--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/
Reply | Threaded
Open this post in threaded view
|

Re: Change Message Destination using Interceptors

James Strachan-2
2009/3/17 DanielR <[hidden email]>:
>
>
> I need to forward the messsage to the proper queue depending on the first 10
> characters of the body of the message.

Sounds like a content based router...
http://camel.apache.org/content-based-router.html

its probably better to do that using Camel rather than as an
interceptor on the broker

--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/
drp
Reply | Threaded
Open this post in threaded view
|

Re: Change Message Destination using Interceptors

drp
I have 2 restrictions:

1. The routing must be done server side
2. The routing depends on the body, not on the header or some property

James.Strachan wrote
2009/3/17 DanielR <romero.cl@gmail.com>:
>
>
> I need to forward the messsage to the proper queue depending on the first 10
> characters of the body of the message.

Sounds like a content based router...
http://camel.apache.org/content-based-router.html

its probably better to do that using Camel rather than as an
interceptor on the broker

--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/
Reply | Threaded
Open this post in threaded view
|

Re: Change Message Destination using Interceptors

James Strachan-2
2009/3/17 DanielR <[hidden email]>:
>
> I have 2 restrictions:
>
> 1. The routing must be done server side
> 2. The routing depends on the body, not on the header or some property

Both of those are fine - just include the content based router inside
the broker process. ActiveMQ can easily host Camel routes by just
including the route definition in the activemq.xml.

Have a look at the <camelContext> in the activemq.xml in the binary
distro of ActiveMQ to see an example route.


--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/
drp
Reply | Threaded
Open this post in threaded view
|

Re: Change Message Destination using Interceptors

drp
I can't get it working... any examples would be nice please

James.Strachan wrote
2009/3/17 DanielR <romero.cl@gmail.com>:
>
> I have 2 restrictions:
>
> 1. The routing must be done server side
> 2. The routing depends on the body, not on the header or some property

Both of those are fine - just include the content based router inside
the broker process. ActiveMQ can easily host Camel routes by just
including the route definition in the activemq.xml.

Have a look at the <camelContext> in the activemq.xml in the binary
distro of ActiveMQ to see an example route.


--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/
Reply | Threaded
Open this post in threaded view
|

Re: Change Message Destination using Interceptors

James Strachan-2
2009/3/17 DanielR <[hidden email]>:
>
> I can't get it working... any examples would be nice please

Here's a bunch of examples...

http://camel.apache.org/examples.html

The spring XQuery example might be a good start...
http://camel.apache.org/spring-xquery-example.html

you might find its easier to write your predicate using Java
http://camel.apache.org/bean-language.html

rather than one of the available expression languages...
http://camel.apache.org/languages.html

See the example route on the bean language page
http://camel.apache.org/bean-language.html


--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/