Sun GlassFish Message Queue 4.4 Developer's Guide for C Clients

MQUnsubscribeDurableMessageConsumer

The MQUnsubscribeDurableMessageConsumer function unsubscribes the specified durable message consumer.


MQUnsubscribeDurableMessageConsumer
                    (const MQSessionHandle   sessionHandle,
                     ConstMQString durableName);

Return Value

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

Parameters

sessionHandle

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

durableName

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

MQ_CANNOT_UNSUBSCRIBE_ACTIVE_CONSUMER

MQ_CONSUMER_NOT_FOUND