camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suralk <>
Subject how to dynamically set the jms queue name
Date Thu, 04 Oct 2012 06:22:38 GMT
Hi All,
This is my use case:
I have several camel contexts deployed independently. I use camel zookeeper
component to dynamically assign unique ids to these contexts:

static String routeId;


   .process(new Processor() {
	public void process(Exchange exchange) throws Exception {
	 routeId =<znode id>;

This routeId  is kept as a static variable.

Now i want to use this static routeId value to set the name of the jms
When jms queue is the producer, this works:

 .process(new Processor() {
public void process(Exchange exchange) throws Exception {
	exchange.getIn().setHeader("CamelJmsDestinationName", routeId);

However, what I want is to set the queue name of the consumer jms endpoint,     
from("jms:" + routeId)    	   

How can I achieve this? Initially I thought that from("jms:" + routeId)
would work. But it doesn't because the value for routeId is not available at
design time.
Can somebody please tell me how this could be done?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message