MQCreateMessageProducer(const MQSessionHandle sessionHandle, MQProducerHandle * producerHandle);
MQStatus. See the MQStatusIsError() function for more information.
The handle to the session to which this producer should belong.
Output parameter for the handle that references the producer.
The MQCreateMessageProducer function creates a message producer that does not have a specified destination. In this case, you will specify the destination when sending the message itself by using either the MQSendMessageToDestination() function or the MQSendMessageToDestinationExt() function.
Using the MQCreateMessageProducer function is appropriate when you want to use the same producer to send messages to a variety of destinations. If, on the other hand, you want to use one producer to send many messages to the same destination, you should use the MQCreateMessageProducerForDestination() function instead.
A session’s producers are automatically closed when you close the session or connection to which they belong. To close a producer without closing the session or connection to which it belongs, use the MQCloseMessageProducer() function.