activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Messages are not delivered for a durable subscription using STOMP on reconnect
Date Fri, 10 Jul 2009 19:40:15 GMT
On Fri, 2009-07-10 at 12:27 -0700, Sidda Eraiah wrote:
> *Summary of the problem
> *
> After reconnecting and resubscribing to a durable subscription, ActiveMQ
> does not send messages - that were sent to the topic while the client with a
> durable subscription was offline.
> 
> I have tested this with version 5.1.0 and 5.2.0 with same results.
> 
> *Details
> *
> Here are the steps to reproduce the problem:
> 
> 
>    1. STOMP client connects with "client-id:connection1" header
>    2. Create a durable subscription with "destination: /topic/destination1"
>    and "activemq.subscriptionName:testdurablesubscription1" headers
>    3. Send messages M1 and M2 to /topic/destination1:
>    4. Client receives these messages  M1 and M2
>    5. Now disconnect using DISCONNECT command
>    6. Using another client publish messages M3, M4 and M5 to
>    /topic/destination1
>    7. Reconnect the STOMP client with "client-id:connection1" header
>    8. Create the durable subscription with "destination:
>    /topic/destination1" and
>    "activemq.subscriptionName:testdurablesubscription1" headers
>    9. *NOW M3, M4 and M5 are not delivered to the client.*
> 
> 
> Using JConsole, I do see the durable subscription with the name
> "testdurablesubscription1" and it has following attributes:
> 
> 
>    - DequeueCounter = 2
>    - EnqueueCounter = 5
>    - PendingQueueSize = 0
> 
> 
> As you can see that there are 3 messages that were not dequeued but the
> PendingQueueSize is 0.
> 
> I have implemented a same test case with Java client using JMS API against
> ActiveMQ and it works just fine. On reconnect and resubscribe, I do get
> M3,M4 and M5 delivered to the client.
> 
> I also looked at
> StompTest.java<https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java>and
> I don't see any tests for same.
> 
> Is this a know issue? What are the right set of STOMP headers to send to get
> this to work.
> 

In Stomp your durable subscription name must be the same as your client
id, see: http://activemq.apache.org/stomp.html

Regards
Tim.


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message