camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Durable subscribe to topic
Date Thu, 07 Jun 2007 09:22:41 GMT
On 6/6/07, Nicky Sandhu <> wrote:
> How do I do a durable subscribe to a topic?
> e.g. from("myjms:topic:default.topic").to(...
> The first step that i can glean from source is to connect to instance of
> active mq like this ?
> ConnectionFactory connectionFactory=new
> ActiveMQConnectionFactory("tcp://localhost:61616?clientId=camel&durableSubscriptionName=simple.q2q&deliveryPersistent=true");
> but then how should the property on the endpoint be set to create a durable
> subscribe to the topic?

The trick is to specify those query arguments on the endpoint URI
rather than the connection factory.



FWIW persistence is the default delivery mode in JMS, so you only
really need to specify it if you wish to disable persistence.

I spotted that there was a bug in the URI handling code if the URI
doesn't have the // notation the query arguments were ignored. So the
above had to be done as


I've just fixed this oversight so that the following will also work...


Incidentally here's the test case that shows that this URI mechanism
does in fact configure the underlying durable subscriber and client ID
in the Spring message listener container thats used...

Since all this stuff was a little murky and non-obvious I've updated
the wiki with much more detailed information on configuration...


View raw message