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

MQCloseMessageConsumer

The MQCloseMessageConsumer function closes the specified message consumer.


MQCloseMessageConsumer(MQConsumerHandle consumerHandle);

Return Value

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

Parameters

consumerHandle

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 successfully.

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

MQ_CONSUMER_NOT_IN_SESSION
MQ_BROKER_CONNECTION_CLOSED