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

MQSendMessageToDestination

The MQSendMessageToDestination function sends a message using the specified producer to the specified destination.


MQSendMessageToDestination
            (const MQProducerHandle  producerHandle,
             const MQMessageHandle messageHandle,
             const MQDestinationHandle destinationHandle);

Return Value

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

Parameters

producerHandle

The handle to the producer sending this message. This handle is passed back to you by the MQCreateMessageProducer() function.

messageHandle

A handle to the message you want to send.

destinationHandle

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.

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.

Common Errors

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