BEA Logo BEA Tuxedo Release 8.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   Tuxedo Documentation   |   Tutorials for Developing BEA Tuxedo ATMI Applications   |   Local Topics   |   Previous Topic   |   Next Topic   |   Contents

 


Using Queue-based Communication

To interface with the /Q system, a BEA Tuxedo client uses two ATMI functions: tpenqueue(), to put messages into the queue space, and tpdequeue(), to take messages out of the queue space.

The following model represents peer-to-peer asynchronous messaging. Here, a client enqueues a message to a service using tpenqueue(). Optionally, the names of a reply queue and a failure queue can be included in the call to tpenqueue(). The client can also specify a correlation identifier value to accompany the message. This value is persistent across queues so that any reply or failure message associated with the queued message can be identified when it is read from the reply or the failure queue.

The client can use the default queue ordering (for example, a time after which the message should be dequeued), or can specify an override of the default queue ordering (asking, for example, that this message be put at the top of the queue or ahead of another message on the queue). The call to tpenqueue() sends the message to the TMQUEUE server, the message is queued to stable storage, and an acknowledgment is sent to the client. The acknowledgment is not seen directly by the client, but can be assumed when the client gets a successful return. (A failure return includes information about the nature of the failure.) A message identifier assigned by the queue manager is returned to the application. The identifier can be used to dequeue a specific message. It can also be used in another tpenqueue() to identify a message on the queue ahead of the next message to be enqueued.

Before an enqueued message is made available for dequeuing, the transaction in which the message is enqueued must be committed successfully. A client uses tpdequeue() to dequeue messages from the queue.

Peer-to-Peer Asynchronous Messaging Model


 

In the following graphic, forwarding a message to another server is illustrated.

The client enqueues a message intended for service X on the server. The service receives this message when it is active and when the handling instructions for the message are met (for example, the message can be encoded to be activated on Friday at 6 PM). Once the service is completed, it returns the reply to the queue space, from which it can be retrieved by the client.

This system of queuing is transparent to services. In other words, the same application code is used for a service, regardless of whether the service is invoked through queuing or direct service invocation using tp(a)call.

Using Queue Forwarding for Queue-based Service Invocation


 

See Also

 

back to top   next page