tibemsMsgProducer_AsyncSend

Function

Purpose

Asynchronously send a message.

C Declaration

tibems_status tibemsMsgProducer_AsyncSend(
    tibemsMsgProducer msgProducer,
    tibemsMsg message
    tibemsMsgCompletionCallback asyncSendCallback,
    void* asyncSendClosure );

tibems_status tibemsMsgProducer_AsyncSendEx(
    tibemsMsgProducer msgProducer,
    tibemsMsg message,
    tibems_int deliveryMode,
    tibems_int priority,
    tibems_long timeToLive
    tibemsMsgCompletionCallback asyncSendCallback,
    void* asyncSendClosure );

tibems_status tibemsMsgProducer_AsyncSendToDestination(
    tibemsMsgProducer msgProducer,
    tibemsDestination destination,
    tibemsMsg message
    tibemsMsgCompletionCallback asyncSendCallback,
    void* asyncSendClosure );

tibems_status tibemsMsgProducer_AsyncSendToDestinationEx(
    tibemsMsgProducer msgProducer,
    tibemsDestination destination,
    tibemsMsg message,
    tibemsDeliveryMode deliveryMode,
    tibems_int priority,
    tibems_long timeToLive
    tibemsMsgCompletionCallback asyncSendCallback,
    void* asyncSendClosure );

Parameters

Parameter Description
msgProducer Send a message through this producer object.
destination Send the message to this destination (queue or topic).

Other send calls send the message to the producer’s default destination. When the producer does not specify a default, the send call must supply this parameter.

message Send this message object.
deliveryMode Send the message with this delivery mode.

This argument is an enumerated value (see tibemsDeliveryMode).

Other send calls send the message with the producer’s default delivery mode.

priority Send the message with this priority.

Priority affects the order in which the server delivers messages to consumers (higher values first). The JMS specification defines ten levels of priority value, from zero (lowest priority) to 9 (highest priority). The specification suggests that clients consider 0–4 as gradations of normal priority, and priorities 5–9 as gradations of expedited priority.

Other send calls send the message with the producer’s default priority.

timeToLive Use this value (in milliseconds) to compute the message expiration.
  • If the time-to-live is non-zero, the expiration is the sum of that time-to-live and the sending client’s current time (GMT). This rule applies even within sessions with transaction semantics—the timer begins with the send call, not the commit call.
  • If the time-to-live is zero, then expiration is also zero—indicating that the message never expires.

Other send calls use the producer’s default value to compute expiration.

Whenever your application uses non-zero values for message expiration or time-to-live, you must ensure that clocks are synchronized among all the host computers that send and receive messages. Synchronize clocks to a tolerance that is a very small fraction of the smallest or time-to-live.

asyncSendCallback A callback to be invoked when a message has successfully been sent.
asyncSendCallbackClosure Data to be passed into the asyncSendCallback.

Remarks

These calls are not supported in COBOL.