MQSendMessageToDestination (const MQProducerHandle producerHandle, const MQMessageHandle messageHandle, const MQDestinationHandle destinationHandle);
MQStatus. See the MQStatusIsError() function for more information.
The handle to the producer sending this message. This handle is passed back to you by the MQCreateMessageProducer() function.
A handle to the message you want to send.
A handle to the destination where you want to send the message.
The MQSendMessageToDestination function sends the specified message on behalf of the specified producer to the specified destination. If you use this function to send a message, the following message header fields are set as follows when the send completes.
MQ_PERSISTENT_HEADER_PROPERTY will be set to MQ_PERSISTENT_DELIVERY.
This means that the caller will be blocked, waiting for broker acknowledgement for the receipt of your messages unless you set the connection property MQ_ACK_ON_PRODUCE_PROPERTY to MQ_FALSE.
MQ_PRIORITY_HEADER_PROPERTY will be set to 4.
MQ_EXPIRATION_HEADER_PROPERTY will be set to 0, which means that the message will never expire.
To send a message with these properties set to different values, you must use the MQSendMessageToDestinationExt() function, which allows you to set these three header properties.
If you set these message headers using the MQSetMessageHeaders function before the send, they will be ignored when the message is sent. When the send completes, these message headers hold the values that are set by the send.
You cannot use this function with a producer that is created with a specified destination.
MQ_PRODUCER_HAS_DEFAULT_DESTINATION MQ_PRODUCER_CLOSED MQ_SESSION_CLOSED MQ_BROKER_CONNECTION_CLOSED MQ_THREAD_OUTSIDE_XA_TRANSACTION MQ_XA_SESSION_NO_TRANSATION