Yes, I've definitely had this scenario working in the past. If I recall correctly, something that tripped me up is that the messages must be persistent with a stomp durable subscription. So try using the 'persistent: true' header when sending the message.
I don't believe this is documented anywhere and I'm not at work right now, so I can't easily verify. If this resolves the problem, it would be helpful if someone with wiki access would update the documentation. JLuna ----- Original Message ---- > From: Sidda Eraiah <sidda.era...@kaazing.com> > To: users@activemq.apache.org > Sent: Friday, July 10, 2009 4:06:27 PM > Subject: Re: Messages are not delivered for a durable subscription using > STOMP on reconnect > > Tim, > > >>In Stomp your durable subscription name must be the same as your client > >>id, see: http://activemq.apache.org/stomp.html > > I changed my code to keep the client-id and activemq.subscriptionName > headers the same ("testdurable1"), but the messages that were sent to the > subscribed topic while being disconnected - still are not delivered on > reconnect and resubscribe. I still see the PendingQueueSize of 0 when the > DequeueCounter is 2 and EnqueueCounter is 5. > > Am I missing any headers? Does anybody on this list got this scenario to > work using STOMP client? > > Thanks in advance. > > Best Regards, > Sidda > > > > On Fri, Jul 10, 2009 at 12:40 PM, Timothy Bish wrote: > > > 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/ > > > > > > > >