112 WCTME: Application Development and Case Study
Queues
A queue is where messages are stored before they are sent to their destination,
and after they have arrived there. A program can define its own queues or use
the standard queues provided by MQe.
A queue can be local or remote. A
local queue resides on the same system as
the program sending messages to it. It could be used, for example, to send
messages between programs running on the same computer. A
remote queue
exists on another computer, but MQe stores messages locally before forwarding
them to their destinations.
A remote queue can be synchronous or asynchronous. A
synchronous queue
requires a connection to the actual queue. An
asynchronous queue allows
messages to be sent even if there is no active connection. Messages are stored
until they are delivered.
Queue managers
Queue managers manage the queues and take care of details of sending and
receiving messages. Your program interacts with the queue manager, rather than
the queues.
In MQe, there can only be one queue manager for each JVM.
Connections
A connection acts as a pipe between queue managers, allowing messages to
flow between computers. A connection identifies the target queue manager, the
IP address and the port number of the listener for the queue manager.
Before you can define a remote queue, you must define a connection to the
remote queue manager. The connection does not have to be active. You do not
have to have a link to the other queue manager, but you must define the
connection.
Listeners
In order for a queue manager to receive messages from another, remote queue
manager, it must have defined a listener. A
listener identifies the port number
where the system will listen for incoming messages. The port number of the
listener must match the port number of any connections to that queue manager.
5.1.3 Message flow in MQe
In order to see how these pieces fit together, we can look at a simple scenario
(Figure 5-1 on page 113) where program A, running on a computer identified as
Client, with an IP address of 192.168.0.100, wants to send a message to