You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Steve Powell <sp...@vmware.com> on 2011/09/13 11:49:45 UTC

STOMP SUBSCRIBE and UNSUBSCRIBE behaviour

I would like some clarification of the precise intended semantics
of the SUBSCRIBE and UNSUBSCRIBE STOMP commands in ActiveMQ.

I hope this is the right mailing list.

I'm particularly interested in the persistent:true cases.

The user-manual[1] says that the SUBSCRIBE id:/persistent:true creates
or reattaches to the durable topic subscription (queue).  When this is a
create I understand this.  When this is a reattach, the case I am
interested in is when the topic differs from that on the
previous/current durable topic subscription.

If the topic is NOT the same, is it really true that all other
subscribers will see only the new topic messages from then on?

The spec:
----8<----
If the second connection uses a different destination or selector header,
then updates the original subscription, and the original connection will
subsequently only receive messages matching the updated destination or
selector.
----8<----

In the case of an UNSUBSCRIBE id:/persistent:true command I want to
know what happens to other (active) durable subscriptions to that id.

Destroying the durable topic subscription seems to imply that the other
subscribers will stop receiving messages for that topic.

The spec:
----8<----
To destroy a durable subscription, you must once again add persistent:true
header to the UNSUBSCRIBE frame.
----8<----
This seems a little surprising behaviour for another client, who may
have durably subscribed to a topic and suddenly not receive anything at
all.

Can you please clarify what is supposed to happen?

Regards,
Steve Powell
[M: +44-7815-838-558; H:+44-1962-775-598]
Links: SpringSource (a division of VMware), Virgo, RabbitMQ.
[1] http://activemq.apache.org/apollo/documentation/user-manual.html

Re: STOMP SUBSCRIBE and UNSUBSCRIBE behaviour

Posted by Aleksandar Ivanisevic <al...@ivanisevic.de>.
Steve Powell <sp...@vmware.com> writes:

> On 28 Sep 2011, at 20:40, tabish121@gmail.com [via ActiveMQ] wrote:
>> Can you clarify what it is you want to know, the stomp spec defines this 
>> pretty clearly already, what part do you need help with? 
>
> Durable topic subscriptions are not described in the STOMP spec.
> My questions relate to ActiveMQ/Apollo STOMP behaviour.

I'm not sure AMQ and Apollo are the same. I can tell you what happens
in AMQ, derived from my empirical observations, since, as you noted,
the documentation is not really useful when we are into details.

> Specifically: if a SUBSCRIBE id:id01;destination:/topic/foo;persistent:true;; is issued
> when an EXISTING global id:id01; destination:/topic/bah;persistent:true;; already exists,
> what happens to active subscribers of the id01 subscription?
>
> This is a repeat subscription with a different topic but the same
> id.

subscriptions are identified with client id and subscription id, not
by destination, so those two will be different if issued from
different client ids. Otherwise you will get kicked out with
javax.jms.InvalidClientIDException.

> Also: if an UNSUBSCRIBE id:id01;persistent:true;; is issued what happens to existing
> active subscribers of the durable subscription id01?
>
> This is an UNSUBSCRIBE of a durable topic subscription

I wasn't able to unsubscribe a durable subscriber from AMQ via STOMP
no matter what I did. The only way to kill a subscription was to
delete it in the web interface.

I've reported it here, but was asked to provide a unit test. Since I'm
an admin and not really familiar with all the tools used in the modern
Java development (took me couple of days just to get AMQ built) I'm
guessing it will take me another couple of months to create a test
case ;)

> The STOMP spec is silent on all semantic issues and the ActiveMQ Apollo specification
> seems to imply that the subscription is destroyed when the UNSUBSCRIBE is issued,
> but it doesn't say what is supposed to happen when a distinct topic destination is
> defined for an existing durable topic subscription.

In AMQ destination doesn't matter, see above.



Re: STOMP SUBSCRIBE and UNSUBSCRIBE behaviour

Posted by Steve Powell <sp...@vmware.com>.
On 28 Sep 2011, at 20:40, tabish121@gmail.com [via ActiveMQ] wrote:
> Can you clarify what it is you want to know, the stomp spec defines this 
> pretty clearly already, what part do you need help with? 

Durable topic subscriptions are not described in the STOMP spec.
My questions relate to ActiveMQ/Apollo STOMP behaviour.

Specifically: if a SUBSCRIBE id:id01;destination:/topic/foo;persistent:true;; is issued
when an EXISTING global id:id01; destination:/topic/bah;persistent:true;; already exists,
what happens to active subscribers of the id01 subscription?

This is a repeat subscription with a different topic but the same id.

Also: if an UNSUBSCRIBE id:id01;persistent:true;; is issued what happens to existing
active subscribers of the durable subscription id01?

This is an UNSUBSCRIBE of a durable topic subscription

The STOMP spec is silent on all semantic issues and the ActiveMQ Apollo specification
seems to imply that the subscription is destroyed when the UNSUBSCRIBE is issued,
but it doesn't say what is supposed to happen when a distinct topic destination is
defined for an existing durable topic subscription.

Regards,
Steve Powell
[M: +44-7815-838-558; H:+44-1962-775-598]
Links: SpringSource (a division of VMware), Virgo, RabbitMQ.

--
View this message in context: http://activemq.2283324.n4.nabble.com/STOMP-SUBSCRIBE-and-UNSUBSCRIBE-behaviour-tp3809620p3859312.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: STOMP SUBSCRIBE and UNSUBSCRIBE behaviour

Posted by Timothy Bish <ta...@gmail.com>.
On Wed, 2011-09-28 at 06:49 -0700, Steve Powell wrote:
> Steve Powell wrote:
> > 
> > I would like some clarification of the precise intended semantics
> > of the SUBSCRIBE and UNSUBSCRIBE STOMP commands in ActiveMQ.
> > 
> > I hope this is the right mailing list.
> > 
> I'm guessing this isn't the right mailing list. Please confirm.
> 

Can you clarify what it is you want to know, the stomp spec defines this
pretty clearly already, what part do you need help with?

Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/




Re: STOMP SUBSCRIBE and UNSUBSCRIBE behaviour

Posted by Steve Powell <sp...@vmware.com>.
Steve Powell wrote:
> 
> I would like some clarification of the precise intended semantics
> of the SUBSCRIBE and UNSUBSCRIBE STOMP commands in ActiveMQ.
> 
> I hope this is the right mailing list.
> 
I'm guessing this isn't the right mailing list. Please confirm.


--
View this message in context: http://activemq.2283324.n4.nabble.com/STOMP-SUBSCRIBE-and-UNSUBSCRIBE-behaviour-tp3809620p3851297.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.