Sun Java System Message Queue 4.3 Developer's Guide for C Clients


The MQUnsubscribeDurableMessageConsumer function unsubscribes the specified durable message consumer.

                    (const MQSessionHandle   sessionHandle,
                     ConstMQString durableName);

Return Value

MQStatus. See the MQStatusIsError() function for more information.



The handle to the session to which this consumer belongs. This handle is created and passed back to you by the MQCreateSession() function.


An MQString specifying the name of the durable subscriber.

When you call the MQUnsubscribeDurableMessageConsumer function, the client runtime instructs the broker to delete the state information that the broker maintains for this consumer. If you try to delete a durable consumer while it has an active topic subscriber or while a received message has not been acknowledged in the session, you will get an error. You should only unsubscribe a durable message consumer after closing it.

Common Errors