To ensure forwarding of messages along routes, servers propagate their topic subscriptions to other servers. For example, the top of Figure 35 depicts an enterprise with three
servers—A, M and
B—connected by routes in a multi-hop zone. The bottom of
Figure 35 illustrates the mechanism at work within the servers to route messages from a producer client of server A, through server M, to server B and its subscriber client. Consider this sequence of events.
If the client of server B creates a non-durable subscriber to T1, then if the client process exits, the servers delete the entire sequence of internal subscribers. When the client restarts, it generates a new sequence of subscribers; meanwhile, the client might have missed messages.
If the client of server B creates a durable subscriber to T1, then if the client process exits, the entire sequence of internal subscribers remains intact; messages continue to flow through the servers in store-and-forward fashion. When the client restarts, it can consume all the messages that B has stored in the interim.
In an active-passive route configured on B, if B fails, then M removes its internal subscriber and does not store messages for clients of B—potentially resulting in a gap in the message stream. When B reconnects, M creates a new internal subscriber and resumes forwarding messages.
Combining durable subscribers with routes creates a potential demand for storage—especially in failure situations. For example, if server B fails, then server M stores messages until B resumes. We recommend that you set the
maxbytes or
maxmsgs property of the topic (T1) on each server, to prevent unlimited storage growth (which could further disrupt operation).
Figure 36 illustrates an enterprise with a central server for processing customer orders, and separate regional servers for billing those orders. For optimal use of network capacity, we configure topic selectors so that each regional server gets only those orders related to customers within its region.
In the example of Figure 36, an administrator might configure these routes on the central order server:
outgoing_topic and
incoming_topic are symmetric. Whether A specifies a route to B with
incoming_topic selectors, or B specifies a route to A with
outgoing_topic selectors, the effect is the same. That is, B sends only those messages that match the selector over the route.
In an active-active configuration, you may specify selectors on either or both servers. If you specify outgoing_topic selector
S1 for topic T on server A, and
incoming_topic selector
S2 for T on server B, then the effective selector for T on the route from A to B is
(S1 AND S2).