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

MQSendMessage

The MQSendMessage function sends a message using the specified producer.


MQSendMessage(const MQProducerHandle producerHandle,
                    const MQMessageHandle messageHandle);

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 MQCreateMessageProducerForDestination() function.

messageHandle

A handle to the message you want to send.

The MQSendMessage function sends the specified message on behalf of the specified producer to the destination associated with the message producer. If you use this function to send a message, the following message header fields are set to default values when the send completes.

If you set those message properties, they will be ignored when a message is sent. To send a message with these properties set to different values, you can use the MQSendMessageExt() function to specify different values for these properties.

You cannot use this function with a producer that is created without a specified destination.

Common Errors

MQ_PRODUCER_NO_DESTINATION
MQ_PRODUCER_CLOSED
MQ_SESSION_CLOSED
MQ_BROKER_CONNECTION_CLOSED
MQ_THREAD_OUTSIDE_XA_TRANSACTION
MQ_XA_SESSION_NO_TRANSATION