On 1/19/07, tim.geldart <[EMAIL PROTECTED]> wrote:


I have observed inexplicable behavior (to me, at least) when using the Stomp
C API to consume messages from a durable subscription. I could not find
prior discussion or bugs filed on this topic, so I would like to know if
this is expected behavior.

I am using the 4.2 snapshot, built from the trunk on 1/19. The broker is
running on Windows with JRE 1.5.0_10. The clients are using the Stomp C API
from a remote Solaris box.

Sending a Stomp UNSUB command after successfully creating and receiving
messages on a durable topic appears to have no effect. The JMX console still
shows the durable subscription under the tree path:
org.apache.activemq/Subscription/Durable. If I manually execute the
destroy() method from the console, the console shows the subscription moved
to org.apache/activemq/Subscription/false.

I am passing the topic destination in the UNSUB header. The broker appears
to receive the UNSUB command (I specify a receipt in the UNSUB request and
subsequently receive the corresponding RECEIPT response from the broker) but
does not appear to handle it properly.

Am I missing some trick to unsubscribing durable topics?

So durable topics are a bit different to other kinds of subscriptions.
When you unsubscribe, it generally just means that you are not
currently able to process messages any more (e.g. when you are
shutting down or something). So unsubscribing does not delete the
subscription (since the whole point of durable topics is to keep a
copy of every message matching the subscription, while the client is
not running).

So to stop collecting messages for durable subscriptions, you need to
delete the subscription via the MBeans - i.e. its an adminstrative
issue (rather than via stomp/jms).

If you want to start/stop subscriptions within a client, then don't
use durable topics, use non-persistent subscriptions

--

James
-------
http://radio.weblogs.com/0112098/

Reply via email to