Chapter 20 Working With Routes : Routed Queues

Routed Queues
With respect to routing, queues differ from topics in several respects:
The left side of Figure 39 depicts an enterprise with three servers—P, R and S—connected by routes. The remainder of Figure 39 illustrates the mechanisms that routes queue messages among servers (center) and their clients (right side).
Figure 39 Routing: Queues
Owner & Home
Server R defines a global queue named Q1. R is the owner of Q1.
Servers P and S define routed queues Q1@R. This designation indicates that these queues depend upon and reflect their home queue (that is, Q1 on server R). Notice that the designation Q1@R is only for the purpose of configuration; clients of P refer to the routed queue as Q1.
Example
When J sends a message to Q1, server P forwards the message to the home queue—Q1 on server R.
Now the message is available to receivers on all three servers, P, R and S—although only one client can consume the message. Either Q1 on P receives it on behalf of K; or Q1 on S receives it on behalf of N; or M receives it directly from the home queue.
Producers
From the perspective of producer clients, a routed queue stores messages and forwards them to the home queue. For example, when J sends a message to Q1 on server P, P forwards it to the queue owner, R, which delivers it to Q1 (the home queue).
The message is not available for consumers until it reaches the home queue. That is, client K cannot consume the message directly from server P.
If server R fails, or the route connection from P to R fails, P continues to store messages from K in its queue. When P and R resume communication, P delivers the stored messages to Q1 on R.
Similarly, routed queues do not generate an exception when the maxbytes and maxmsgs limits are exceeded in the routed server. Clients can continue to send messages to the queue after the limit is reached, and the messages will be stored in the routed server until the error condition is cleared.
Consumers
From the perspective of consumer clients, a routed queue acts as a proxy receiver. For example, when L sends a message to Q1 on server R, Q1 on P can receive it from R on behalf of K, and immediately gives it to K.
If server P fails, or the route connection from P to R fails, K cannot receive messages from Q1 until the servers resume communication. Meanwhile, M and N continue to receive messages from Q1. When P and R resume communication, K can again receive messages through Q1 on P.
Configuration
You must explicitly configure each routed queue in queues.conf—clients cannot create routed queues dynamically.
You may use the administration tool or API to configure routed queues; see addprop queue on page 114 and create queue on page 118.
To configure a routed queue, specify the queue name and the server name of the queue owner; for example, on server P, configure:
 Q1@R global
It is legal to use this notation even for the home queue. The queue owner recognizes its own name, and ignores the location designation (@R).
It is illegal to configure a routed queue as exclusive.
Browsing
Queue browsers cannot examine routed queues. That is, you can create a browser only on the server that owns the home queue.
Transactions