Oracle GlassFish Message Queue 4.4.2 Developer's Guide for C Clients

MQStopConnection

The MQStopConnection function stops the specified connection to the broker. This stops the broker from delivering messages.


MQStopConnection
               (const MQConnectionHandle connectionHandle);

Return Value

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

Parameters

connectionHandle

The handle to the connection that you want to stop. This handle is passed back to you by the MQCreateConnection() function.

You can restart message delivery by calling the MQStartConnection() function. When the connection has stopped, delivery to all the connection’s message consumers is inhibited: synchronous receives block, and messages are not delivered to message listeners. This call blocks until receives and/or message listeners in progress have completed.

You should not call MQStopConnection in a message listener callback function.

Use the MQCloseConnection() function to close a connection, and then use the MQFreeConnection() function to free the memory allocated to the connection.

Common Errors

MQ_BROKER_CONNECTION_CLOSED

MQ_CONCURRENT_DEADLOCK