Synchronous and asynchronous

The difference between the two types of remote queue definition is that with synchronous a message put to a remote queue definition is sent over the network in real-time and put to the queue on the remote queue manager, whereas with asynchronous the message is put to a temporary store and transmitted when a network connection becomes available.

See more at Message delivery.

Synchronous
Synchronous remote queues are queues that can only be accessed when connected to a network that has a communications path to the owning queue manager (or next hop). If the network is not established then the operations such as put, get, and browse cause an exception to be raised. The owning queue controls the access permissions and security requirements needed to access the queue. It is the application's responsibility to handle any errors or retries when sending or receiving messages as, in this case, MQe is no longer responsible for once-only assured delivery.
Asynchronous
Asynchronous remote queues are queues that move messages to remote queues but cannot remotely retrieve messages. When message are put to the remote queue, the messages are temporarily stored locally. When there is network connectivity, transmission has been triggered and rules allow, an attempt is made to move the messages to the target queue. Message delivery will be once-only assured delivery.

This allows applications to operate on the queue when the device is offline. Consequently, asynchronous queues require a message store in order that messages can be temporarily stored at the sending queue manager whilst awaiting transmission.

Note: In the Java™ code base, the mode of an instance of the MQeRemoteQueue class is set to Queue_Synchronous or Queue_Asynchronous to indicate whether the queue is synchronous or asynchronous. In the native code base, two distinct sets of APIs are used to create and administer synchronous and asynchronous remote queues.

This diagram shows an example of a remote queue set up for synchronous operation and a remote queue setup for asynchronous operation.


Two diagrams showing a put message from queue manager qm1 to a remote queue invQ on qm2, and the message being retrieved with getMessage. The first diagram shows asynchronous transmission with no real queue store on qm1. The second diagram shows asysnchronous transmission with a real queue store on qm1.

In both the synchronous and asynchronous examples queue manager qm2 has a local queue invQ.

In the synchronous example, queue manager qm1 has a remote queue definition of queue invQ. invQ resides on queue manager qm2. The mode of operation is set to synchronous.

An application using queue manager qm1 and putting messages to queue qm2.invQ establishes a network connection to queue manager qm2 (if it does not already exist) and the message is immediately put on the real queue. If the network connection cannot be established then the application receives an exception that it must handle.

In the asynchronous example, queue manager qm1 has a remote queue definition of queue invQ. invQ resides on queue manager qm2. The mode of operation is set to asynchronous.

An application using queue manager qm1 and putting messages to queue qm2.invQ stores messages temporarily on the remote queue on qm1. When the transmission rules allow, the message is moved to the real queue on queue manager qm2. The message remains on the remote queue until the transmission is successful.


Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.