A durable consumer won't receive messagew sent before it was started if
it has never subscribed to the broker before.  The purpose of a durable
consumer is to allow a consumer to disconnect and then reconnect and
receive any messages sent since the last time it was connected.  So if
you are starting out with a clean broker and subscribing that consumer
for the first time then it won't receive any messages that were sent on
the topic before it became active.  You could try using a retroactive
consumer but this isn't a bulletproof solution either, see here for more
details on retroactive consumers:

http://activemq.apache.org/retroactive-consumer.html

Durable VS Non-Durable:
http://activemq.apache.org/how-do-durable-queues-and-topics-work.html

Topics VS Queues:
http://activemq.apache.org/how-does-a-queue-compare-to-a-topic.html


Regards
Tim.

On Mon, 2009-01-26 at 06:52 -0800, zunrise wrote:
> First thx for quick reply. I'm already using durableconsumers. My
> subscribition Client is written in .net and I'm using NMS. Can anyone send
> me a sample code how to let it work. The problem is that the message isn't
> send to durable consumer, if the consumer subscribes first time after a
> message is send.
> 
> 
> 
> Timothy Bish wrote:
> > 
> > Sending to a topic that has no subscribers won't by default hold the
> > message until someone subscribes.  You could use retroactive consumers,
> > or durable consumers to solve this, or switch to using a queue if that
> > would meet your needs.  
> > 
> > You may want to read the JMS tutorial to get a feel for when to use each
> > solution.
> > http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/copyright.html
> > 
> > regards
> > Tim.
> > 
> > On Mon, 2009-01-26 at 05:39 -0800, zunrise wrote:
> >> Hi, 
> >> currentlly I have the following problem. If I first create a Publisher
> >> and
> >> send a message to a topic and after that I create a subscriber, the
> >> subscriber wont receive the send message. How can I solve this problem.
> >> Need
> >> help asap.
> >> 
> >> Thx Denis
> > -- 
> > Tim Bish
> > http://fusesource.com
> > http://timbish.blogspot.com/
> > 
> > 
> > 
> > 
> > 
> 
-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/



Reply via email to