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


The MQCloseMessageConsumer function closes the specified message consumer.

MQCloseMessageConsumer(MQConsumerHandle consumerHandle);

Return Value

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



The handle to the consumer you want to close. This handle is created and passed back to you by one of the functions used to create consumers.

This handle is invalid after the function returns.

A session’s consumers are automatically closed when you close the session or connection to which they belong. To close a consumer without closing the session or connection to which it belongs, use the functionMQCloseMessageConsumer.

If the consumer you want to close is a durable consumer and you want to close this consumer permanently, you should call the function MQUnsubscribeDurableMessageConsumer after closing the consumer in order to delete any state information maintained by the broker for this consumer.

Common Errors