Testing the shared durable subscription functionality against Qpid Broker-J I found that if I attempted to unsubscribe a shared durable subscription from client A, while still having an active consumer from client B, then no exception was thrown in client A.
The protocol trace from the client A is as follows:
While the broker is sending back a detach with closed=true (which is essentially accurate) it is also providing an error. The JMS API docs have this to say:
It is erroneous for a client to delete a durable subscription while there is an active (not closed) consumer for the subscription, or while a consumed message is part of a pending transaction or has not been acknowledged in the session.
So I presume we should be triggering off the fact that the broker sent detach contains an error to throw an appropriate JMSException