Take a look at StompTest.testDurableUnsub()

https://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?hb=true


It contains some example that should work. If it's not working, can you
please provide a similar test case
<https://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?hb=true>
Regards
-- 
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net

Connect at CamelOne <http://camelone.com/> May 24-26

The Open Source Integration Conference



On Fri, May 27, 2011 at 3:46 PM, Aleksandar Ivanisevic <
aleksan...@ivanisevic.de> wrote:

> Timothy Bish <tabish...@gmail.com>
> writes:
>
> > Refer to the ActiveMQ documentation on Stomp here:
> > http://activemq.apache.org/stomp.html
> >
> > Note the discussion at the bottom of the page for the subscription name
> > property,
> >
> > "For durable topic subscriptions you must specify the same clientId on
> > the connection and subcriptionName on the subscribe."
>
> I am always supplying the same client-id, it is actually the same
> STOMP session. What I don't understand is how come to create the
> subscription I have to put the durable name in
> activemq.subscriptionName header, but when unsubscribing if I put it
> in the same header i get an exception in amq log, and if I put it in
> the id header (which I found by looking at the sources) it seems
> successful (i.e. no error) but still doesn't work.
>
> Can you (or someone, anyone) please provide an example of subscribing
> and unsubscribing to a durable topic?
>
> >>
> >> [27664] T+0 DEBUG (re)connecting...
> >> send [CONNECT
> >> client-id:adminbroker-test
> >> passcode:xxx
> >> login:xxx
> >>
> >> ]
> >> receive [CONNECTED
> >> session:adminbroker-test
> >>
> >> ]
> >> send [SUBSCRIBE
> >> activemq.prefetchSize:5
> >> activemq.subscriptionName:masterbcast
> >> ack:client-individual
> >> destination:/topic/COMMAND.broadcast
> >>
> >> ]
> >> [27664] T+0 DEBUG subscribed to /topic/COMMAND.broadcast prefetchSize=5
> durable name=masterbcast
> >>
> >> ...
> >>
> >> [27664] T+15 DEBUG got exit command, shutting down cleanly...
> >> send [UNSUBSCRIBE
> >> activemq.subscriptionName:masterbcast
> >> destination:/topic/COMMAND.broadcast
> >>
> >> ]
> >> [27664] T+15 DEBUG unsubscribed from /topic/COMMAND.broadcast durable
> name=masterbcast
> >> send [DISCONNECT
> >>
> >> ]
> >>
> >> in activemq.log I see
> >>
> >> 2011-05-27 13:01:07,042 | WARN  | Async error occurred:
> javax.jms.InvalidDestinationException: No durable subscription exists for:
> masterbcast | org.apache.activemq.broker.TransportConnection.Service |
> ActiveMQ Transport: ssl:///192.168.222.78:40678
> >> javax.jms.InvalidDestinationException: No durable subscription exists
> for: masterbcast
> >>         at
> org.apache.activemq.broker.region.TopicRegion.removeSubscription(TopicRegion.java:135)
> >>         at
> org.apache.activemq.broker.region.RegionBroker.removeSubscription(RegionBroker.java:491)
> >>         at
> org.apache.activemq.broker.BrokerFilter.removeSubscription(BrokerFilter.java:102)
> >>         at
> org.apache.activemq.broker.BrokerFilter.removeSubscription(BrokerFilter.java:102)
> >>
> >
> > --
> > Tim Bish
> > ------------
> > FuseSource
> > Email: tim.b...@fusesource.com
> > Web: http://fusesource.com
> > Twitter: tabish121
> > Blog: http://timbish.blogspot.com/
> >
> > Connect at CamelOne May 24-26
> >
> > The Open Source Integration Conference
> >
> >
>
> --
> Ti si arogantan, prepotentan i peglaš vlastitu frustraciju. -- Ivan
> Tišljar, hr.comp.os.linux
>
>

Reply via email to