You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by zunrise <de...@artkontrast.de> on 2009/01/26 14:39:10 UTC

Receiving messages from a Topic

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
-- 
View this message in context: http://www.nabble.com/Receiving-messages-from-a-Topic-tp21665556p21665556.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Receiving messages from a Topic

Posted by Timothy Bish <ta...@gmail.com>.
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/




Re: Receiving messages from a Topic

Posted by James Strachan <ja...@gmail.com>.
Are you using a fixed clientID and subscriberName?

2009/1/26 zunrise <de...@artkontrast.de>:
>
> 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/
>>
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Receiving-messages-from-a-Topic-tp21665556p21666696.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



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

Open Source Integration
http://fusesource.com/

Re: Receiving messages from a Topic

Posted by zunrise <de...@artkontrast.de>.
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/
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Receiving-messages-from-a-Topic-tp21665556p21666696.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Receiving messages from a Topic

Posted by Timothy Bish <ta...@gmail.com>.
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/