Added: 
qpid/site/docs/books/0.20/AMQP-Messaging-Broker-CPP-Book/html/chap-Messaging_User_Guide-Broker_Federation.html
URL: 
http://svn.apache.org/viewvc/qpid/site/docs/books/0.20/AMQP-Messaging-Broker-CPP-Book/html/chap-Messaging_User_Guide-Broker_Federation.html?rev=1413422&view=auto
==============================================================================
--- 
qpid/site/docs/books/0.20/AMQP-Messaging-Broker-CPP-Book/html/chap-Messaging_User_Guide-Broker_Federation.html
 (added)
+++ 
qpid/site/docs/books/0.20/AMQP-Messaging-Broker-CPP-Book/html/chap-Messaging_User_Guide-Broker_Federation.html
 Sun Nov 25 21:12:24 2012
@@ -0,0 +1,320 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; 
charset=UTF-8"><title>1.4. Broker Federation</title><link rel="stylesheet" 
href="css/style.css" type="text/css"><meta name="generator" content="DocBook 
XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="AMQP 
Messaging Broker (Implemented in C++)"><link rel="up" href="ch01.html" 
title="Chapter 1.  Running the AMQP Messaging Broker"><link rel="prev" 
href="ch01s03.html" title="1.3.  Cheat Sheet for configuring Exchange 
Options"><link rel="next" href="chap-Messaging_User_Guide-Security.html" 
title="1.5. Security"></head><body><div class="container" bgcolor="white" 
text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><DIV 
class="header"><DIV class="logo"><H1>Apache Qpid™</H1><H2>Open Source AMQP 
Messaging</H2></DIV></DIV><DIV class="menu_box"><DIV 
class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>Apache 
Qpid</H3><UL><LI><A href="http://qpid.apache.org/index.html";>Ho
 me</A></LI><LI><A 
href="http://qpid.apache.org/download.html";>Download</A></LI><LI><A 
href="http://qpid.apache.org/getting_started.html";>Getting 
Started</A></LI><LI><A 
href="http://www.apache.org/licenses/";>License</A></LI><LI><A 
href="https://cwiki.apache.org/qpid/faq.html";>FAQ</A></LI></UL></DIV><DIV 
class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV 
class="menu_box_body"><H3>Documentation</H3><UL><LI><A 
href="http://qpid.apache.org/documentation.html#doc-release";>Latest 
Release</A></LI><LI><A 
href="http://qpid.apache.org/documentation.html#doc-trunk";>Trunk</A></LI><LI><A 
href="http://qpid.apache.org/documentation.html#doc-archives";>Archive</A></LI></UL></DIV><DIV
 class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV 
class="menu_box_body"><H3>Community</H3><UL><LI><A 
href="http://qpid.apache.org/getting_involved.html";>Getting 
Involved</A></LI><LI><A 
href="http://qpid.apache.org/source_repository.html";>Source 
Repository</A></LI><LI><A href="http
 ://qpid.apache.org/mailing_lists.html">Mailing Lists</A></LI><LI><A 
href="https://cwiki.apache.org/qpid/";>Wiki</A></LI><LI><A 
href="https://issues.apache.org/jira/browse/qpid";>Issue 
Reporting</A></LI><LI><A 
href="http://qpid.apache.org/people.html";>People</A></LI><LI><A 
href="http://qpid.apache.org/acknowledgements.html";>Acknowledgements</A></LI></UL></DIV><DIV
 class="menu_box_bottom"></DIV><DIV class="menu_box_top"></DIV><DIV 
class="menu_box_body"><H3>Developers</H3><UL><LI><A 
href="https://cwiki.apache.org/qpid/building.html";>Building Qpid</A></LI><LI><A 
href="https://cwiki.apache.org/qpid/developer-pages.html";>Developer 
Pages</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV 
class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About 
AMQP</H3><UL><LI><A href="http://qpid.apache.org/amqp.html";>What is 
AMQP?</A></LI></UL></DIV><DIV class="menu_box_bottom"></DIV><DIV 
class="menu_box_top"></DIV><DIV class="menu_box_body"><H3>About 
Apache</H3><UL><LI><A href="http
 ://www.apache.org">Home</A></LI><LI><A 
href="http://www.apache.org/foundation/sponsorship.html";>Sponsorship</A></LI><LI><A
 href="http://www.apache.org/foundation/thanks.html";>Thanks</A></LI><LI><A 
href="http://www.apache.org/security/";>Security</A></LI></UL></DIV><DIV 
class="menu_box_bottom"></DIV></DIV><div class="main_text_area"><div 
class="main_text_area_top"></div><div class="main_text_area_body"><DIV 
class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">AMQP 
Messaging Broker (Implemented in C++)</a></span> &gt; <span 
class="breadcrumb-link"><a href="ch01.html">
+      Running the AMQP Messaging Broker
+    </a></span> &gt; <span class="breadcrumb-node">Broker 
Federation</span></DIV><div class="section" lang="en"><div 
class="titlepage"><div><div><h2 class="title"><a 
name="chap-Messaging_User_Guide-Broker_Federation"></a>1.4. Broker 
Federation</h2></div></div></div><p>
+               <em class="firstterm">Broker Federation</em> allows messaging 
networks to be defined by creating <em class="firstterm">message routes</em>, 
in which messages in one broker (the <em class="firstterm">source broker</em>) 
are automatically routed to another broker (the <em 
class="firstterm">destination broker</em>). These routes may be defined between 
exchanges in the two brokers (the <em class="firstterm">source exchange</em> 
and the <em class="firstterm">destination exchange</em>), or from a queue in 
the source broker (the <em class="firstterm">source queue</em>) to an exchange 
in the destination broker. Message routes are unidirectional; when 
bidirectional flow is needed, one route is created in each direction. Routes 
can be durable or transient. A durable route survives broker restarts, 
restoring a route as soon as both the source broker and the destination are 
available. If the connection to a destination is lost, messages associated with 
a durable route continue to accu
 mulate on the source, so they can be retrieved when the connection is 
reestablished.
+       </p><p>
+               Broker Federation can be used to build large messaging 
networks, with many brokers, one route at a time. If network connectivity 
permits, an entire distributed messaging network can be configured from a 
single location. The rules used for routing can be changed dynamically as 
servers change, responsibilities change, at different times of day, or to 
reflect other changing conditions.
+       </p><p>
+               Broker Federation is useful in a wide variety of scenarios. 
Some of these have to do with functional organization; for instance, brokers 
may be organized by geography, service type, or priority. Here are some use 
cases for federation: 
+               </p><div class="itemizedlist"><ul><li><p>
+                                       Geography: Customer requests may be 
routed to a processing location close to the customer.
+                               </p></li><li><p>
+                                       Service Type: High value customers may 
be routed to more responsive servers.
+                               </p></li><li><p>
+                                       Load balancing: Routing among brokers 
may be changed dynamically to account for changes in actual or anticipated load.
+                               </p></li><li><p>
+                                       High Availability: Routing may be 
changed to a new broker if an existing broker becomes unavailable.
+                               </p></li><li><p>
+                                       WAN Connectivity: Federated routes may 
connect disparate locations across a wide area network, while clients connect 
to brokers on their own local area network. Each broker can provide persistent 
queues that can hold messages even if there are gaps in WAN connectivity.
+                               </p></li><li><p>
+                                       Functional Organization: The flow of 
messages among software subsystems can be configured to mirror the logical 
structure of a distributed application.
+                               </p></li><li><p>
+                                       Replicated Exchanges: High-function 
exchanges like the XML exchange can be replicated to scale performance.
+                               </p></li><li><p>
+                                       Interdepartmental Workflow: The flow of 
messages among brokers can be configured to mirror interdepartmental workflow 
at an organization.
+                               </p></li></ul></div><p>
+
+       </p><div class="section" lang="en"><div class="titlepage"><div><div><h3 
class="title"><a 
name="sect-Messaging_User_Guide-Broker_Federation-Message_Routes"></a>1.4.1. Message
 Routes</h3></div></div></div><p>
+                       Broker Federation is done by creating message routes. 
The destination for a route is always an exchange on the destination broker. By 
default, a message route is created by configuring the destination broker, 
which then contacts the source broker to subscribe to the source queue. This is 
called a <em class="firstterm">pull route</em>. It is also possible to create a 
route by configuring the source broker, which then contacts the destination 
broker in order to send messages. This is called a <em class="firstterm">push 
route</em>, and is particularly useful when the destination broker may not be 
available at the time the messaging route is configured, or when a large number 
of routes are created with the same destination exchange.
+               </p><p>
+                       The source for a route can be either an exchange or a 
queue on the source broker. If a route is between two exchanges, the routing 
criteria can be given explicitly, or the bindings of the destination exchange 
can be used to determine the routing criteria. To support this functionality, 
there are three kinds of message routes: queue routes, exchange routes, and 
dynamic exchange routes.
+               </p><div class="section" lang="en"><div 
class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-Message_Routes-Queue_Routes"></a>1.4.1.1. Queue
 Routes</h4></div></div></div><p>
+                               <em class="firstterm">Queue Routes</em> route 
all messages from a source queue to a destination exchange. If message 
acknowledgement is enabled, messages are removed from the queue when they have 
been received by the destination exchange; if message acknowledgement is off, 
messages are removed from the queue when sent.
+                       </p></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-Message_Routes-Exchange_Routes"></a>1.4.1.2. Exchange
 Routes</h4></div></div></div><p>
+                               <em class="firstterm">Exchange routes</em> 
route messages from a source exchange to a destination exchange, using a 
binding key (which is optional for a fanout exchange).
+                       </p><p>
+                               Internally, creating an exchange route creates 
a private queue (auto-delete, exclusive) on the source broker to hold messages 
that are to be routed to the destination broker, binds this private queue to 
the source broker exchange, and subscribes the destination broker to the queue.
+                       </p></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-Message_Routes-Dynamic_Exchange_Routes"></a>1.4.1.3. Dynamic
 Exchange Routes</h4></div></div></div><p>
+                               Dynamic exchange routes allow a client to 
create bindings to an exchange on one broker, and receive messages that satisfy 
the conditions of these bindings not only from the exchange to which the client 
created the binding, but also from other exchanges that are connected to it 
using dynamic exchange routes. If the client modifies the bindings for a given 
exchange, they are also modified for dynamic exchange routes associated with 
that exchange.
+                       </p><p>
+                               <em class="firstterm">Dynamic exchange 
routes</em> apply all the bindings of a destination exchange to a source 
exchange, so that any message that would match one of these bindings is routed 
to the destination exchange. If bindings are added or removed from the 
destination exchange, these changes are reflected in the dynamic exchange route 
-- when the destination broker creates a binding with a given binding key, this 
is reflected in the route, and when the destination broker drops a binding with 
a binding key, the route no longer incurs the overhead of transferring messages 
that match the binding key among brokers. If two exchanges have dynamic 
exchange routes to each other, then all bindings in each exchange are reflected 
in the dynamic exchange route of the other. In a dynamic exchange route, the 
source and destination exchanges must have the same exchange type, and they 
must have the same name; for instance, if the source exchange is a direct 
exchange, the destinatio
 n exchange must also be a direct exchange, and the names must match.
+                       </p><p>
+                               Internally, dynamic exchange routes are 
implemented in the same way as exchange routes, except that the bindings used 
to implement dynamic exchange routes are modified if the bindings in the 
destination exchange change.
+                       </p><p>
+                               A dynamic exchange route is always a pull 
route. It can never be a push route.
+                       </p></div></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h3 class="title"><a 
name="sect-Messaging_User_Guide-Broker_Federation-Federation_Topologies"></a>1.4.2. Federation
 Topologies</h3></div></div></div><p>
+                       A federated network is generally a tree, star, or line, 
using bidirectional links (implemented as a pair of unidirectional links) 
between any two brokers. A ring topology is also possible, if only 
unidirectional links are used.
+               </p><p>
+                       Every message transfer takes time. For better 
performance, you should minimize the number of brokers between the message 
origin and final destination. In most cases, tree or star topologies do this 
best.
+               </p><p>
+                       For any pair of nodes A,B in a federated network, there 
should be only one path from A to B. If there is more than one path, message 
loops can cause duplicate message transmission and flood the federated network. 
The topologies discussed above do not have message loops. A ring topology with 
bidirectional links is one example of a topology that does cause this problem, 
because a given broker can receive the same message from two different brokers. 
Mesh topologies can also cause this problem.
+               </p></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h3 class="title"><a 
name="sect-Messaging_User_Guide-Broker_Federation-Federation_among_High_Availability_Message_Clusters"></a>1.4.3. Federation
 among High Availability Message Clusters</h3></div></div></div><p>
+                       Federation is generally used together with High 
Availability Message Clusters, using clusters to provide high availability on 
each LAN, and federation to route messages among the clusters. Because message 
state is replicated within a cluster, it makes little sense to define message 
routes between brokers in the same cluster.
+               </p><p>
+                       To create a message route between two clusters, simply 
create a route between any one broker in the first cluster and any one broker 
in the second cluster. Each broker in a given cluster can use message routes 
defined for another broker in the same cluster. If the broker for which a 
message route is defined should fail, another broker in the same cluster can 
restore the message route.
+               </p></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h3 class="title"><a 
name="sect-Messaging_User_Guide-Broker_Federation-The_qpid_route_Utility"></a>1.4.4. The
 qpid-route Utility</h3></div></div></div><p>
+                       <span 
class="command"><strong>qpid-route</strong></span> is a command line utility 
used to configure federated networks of brokers and to view the status and 
topology of networks. It can be used to configure routes among any brokers that 
<span class="command"><strong>qpid-route</strong></span> can connect to.
+               </p><p>
+                       The syntax of <span 
class="command"><strong>qpid-route</strong></span> is as follows:
+               </p><pre class="screen">
+qpid-route [OPTIONS] dynamic add &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;exchange&gt; 
+qpid-route [OPTIONS] dynamic del &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;exchange&gt;
+
+qpid-route [OPTIONS] route add &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;exchange&gt; &lt;routing-key&gt; 
+qpid-route [OPTIONS] route del &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;exchange&gt; &lt;routing-key&gt;
+
+qpid-route [OPTIONS] queue add &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;dest-exchange&gt;  &lt;src-queue&gt;
+qpid-route [OPTIONS] queue del &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;dest-exchange&gt;  &lt;src-queue&gt;
+
+qpid-route [OPTIONS] list  [&lt;broker&gt;]
+qpid-route [OPTIONS] flush [&lt;broker&gt;]    
+qpid-route [OPTIONS] map   [&lt;broker&gt;]
+
+
+qpid-route [OPTIONS] list connections [&lt;broker&gt;]
+</pre><p>
+                       The syntax for <span 
class="command"><strong>broker</strong></span>, <span 
class="command"><strong>dest-broker</strong></span>, and <span 
class="command"><strong>src-broker</strong></span> is as follows:
+               </p><pre class="screen">
+[username/password@] hostname | ip-address [:&lt;port&gt;]
+</pre><p>
+                       The following are all valid examples of the above 
syntax: <span class="command"><strong>localhost</strong></span>, <span 
class="command"><strong>10.1.1.7:10000</strong></span>, <span 
class="command"><strong>broker-host:10000</strong></span>, <span 
class="command"><strong>guest/guest@localhost</strong></span>.
+               </p><p>
+                       These are the options for <span 
class="command"><strong>qpid-route</strong></span>:
+               </p><div class="table"><a 
name="tabl-Messaging_User_Guide-The_qpid_route_Utility-qpid_route_options"></a><p
 class="title"><b>Table 1.2. <span class="command">qpid-route</span> 
options</b></p><div class="table-contents"><table summary="qpid-route options" 
border="1"><colgroup><col align="left"><col 
align="left"></colgroup><tbody><tr><td align="left">
+                                                       <span 
class="command"><strong>-v</strong></span>
+                                               </td><td align="left">
+                                                       Verbose output.
+                                               </td></tr><tr><td align="left">
+                                                       <span 
class="command"><strong>-q</strong></span>
+                                               </td><td align="left">
+                                                       Quiet output, will not 
print duplicate warnings.
+                                               </td></tr><tr><td align="left">
+                                                       <span 
class="command"><strong>-d</strong></span>
+                                               </td><td align="left">
+                                                       Make the route durable.
+                                               </td></tr><tr><td align="left">
+                                                       <span 
class="command"><strong> --timeout N</strong></span>
+                                               </td><td align="left">
+                                                       Maximum time to wait 
when qpid-route connects to a broker, in seconds. Default is 10 seconds.
+                                               </td></tr><tr><td align="left">
+                                                       <span 
class="command"><strong>--ack N</strong></span>
+                                               </td><td align="left">
+                                                       Acknowledge transfers 
of routed messages in batches of N. Default is 0 (no acknowledgements). Setting 
to 1 or greater enables acknowledgements; when using acknowledgements, values 
of N greater than 1 can significnantly improve performance, especially if there 
is significant network latency between the two brokers.
+                                               </td></tr><tr><td align="left">
+                                                       <span 
class="command"><strong>-s [ --src-local ]</strong></span>
+                                               </td><td align="left">
+                                                       Configure the route in 
the source broker (create a push route).
+                                               </td></tr><tr><td align="left">
+                                                       <span 
class="command"><strong>-t &lt;transport&gt; [ --transport 
&lt;transport&gt;]</strong></span>
+                                               </td><td align="left">
+                                                       Transport protocol to 
be used for the route. 
+                                                       <div 
class="itemizedlist"><ul><li><p>
+                                                                               
tcp (default)
+                                                                       
</p></li><li><p>
+                                                                               
ssl
+                                                                       
</p></li><li><p>
+                                                                               
rdma
+                                                                       
</p></li></ul></div>
+
+                                               
</td></tr></tbody></table></div></div><br class="table-break"><div 
class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-The_qpid_route_Utility-Creating_and_Deleting_Queue_Routes"></a>1.4.4.1. Creating
 and Deleting Queue Routes</h4></div></div></div><p>
+                               The syntax for creating and deleting queue 
routes is as follows:
+                       </p><pre class="screen">
+qpid-route [OPTIONS] queue add &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;dest-exchange&gt; &lt;src-queue&gt;
+qpid-route [OPTIONS] queue del &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;dest-exchange&gt; &lt;src-queue&gt;
+</pre><p>
+                               For instance, the following creates a queue 
route that routes all messages from the queue named <span 
class="command"><strong>public</strong></span> on the source broker <span 
class="command"><strong>localhost:10002</strong></span> to the <span 
class="command"><strong>amq.fanout</strong></span> exchange on the destination 
broker <span class="command"><strong>localhost:10001</strong></span>:
+                       </p><pre class="screen">
+$ qpid-route queue add localhost:10001 localhost:10002 amq.fanout public
+</pre><p>
+                               If the <span 
class="command"><strong>-d</strong></span> option is specified, this queue 
route is persistent, and will be restored if one or both of the brokers is 
restarted:
+                       </p><pre class="screen">
+$ qpid-route -d queue add localhost:10001 localhost:10002 amq.fanout public
+</pre><p>
+                               The <span 
class="command"><strong>del</strong></span> command takes the same arguments as 
the <span class="command"><strong>add</strong></span> command. The following 
command deletes the queue route described above:
+                       </p><pre class="screen">
+$ qpid-route queue del localhost:10001 localhost:10002 amq.fanout public
+</pre></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-The_qpid_route_Utility-Creating_and_Deleting_Exchange_Routes"></a>1.4.4.2. Creating
 and Deleting Exchange Routes</h4></div></div></div><p>
+                               The syntax for creating and deleting exchange 
routes is as follows:
+                       </p><pre class="screen">
+qpid-route [OPTIONS] route add &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;exchange&gt; &lt;routing-key&gt; 
+qpid-route [OPTIONS] route del &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;exchange&gt; &lt;routing-key&gt;
+qpid-route [OPTIONS] flush [&lt;broker&gt;]
+</pre><p>
+                               For instance, the following creates an exchange 
route that routes messages that match the binding key <span 
class="command"><strong>global.#</strong></span> from the <span 
class="command"><strong>amq.topic</strong></span> exchange on the source broker 
<span class="command"><strong>localhost:10002</strong></span> to the <span 
class="command"><strong>amq.topic</strong></span> exchange on the destination 
broker <span class="command"><strong>localhost:10001</strong></span>:
+                       </p><pre class="screen">
+$ qpid-route route add localhost:10001 localhost:10002 amq.topic global.#
+</pre><p>
+                               In many applications, messages published to the 
destination exchange should also be routed to the source exchange. This is 
accomplished by creating a second exchange route, reversing the roles of the 
two exchanges:
+                       </p><pre class="screen">
+$ qpid-route route add localhost:10002 localhost:10001 amq.topic global.#
+</pre><p>
+                               If the <span 
class="command"><strong>-d</strong></span> option is specified, the exchange 
route is persistent, and will be restored if one or both of the brokers is 
restarted:
+                       </p><pre class="screen">
+$ qpid-route -d route add localhost:10001 localhost:10002 amq.fanout public
+</pre><p>
+                               The <span 
class="command"><strong>del</strong></span> command takes the same arguments as 
the <span class="command"><strong>add</strong></span> command. The following 
command deletes the first exchange route described above:
+                       </p><pre class="screen">
+$ qpid-route route del localhost:10001 localhost:10002 amq.topic global.#
+</pre></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-The_qpid_route_Utility-Deleting_all_routes_for_a_broker"></a>1.4.4.3. Deleting
 all routes for a broker</h4></div></div></div><p>
+                               Use the <span 
class="command"><strong>flush</strong></span> command to delete all routes for 
a given broker:
+                       </p><pre class="screen">
+qpid-route [OPTIONS] flush [&lt;broker&gt;]
+</pre><p>
+                               For instance, the following command deletes all 
routes for the broker <span 
class="command"><strong>localhost:10001</strong></span>:
+                       </p><pre class="screen">
+$ qpid-route flush localhost:10001
+</pre></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-The_qpid_route_Utility-Creating_and_Deleting_Dynamic_Exchange_Routes"></a>1.4.4.4. Creating
 and Deleting Dynamic Exchange Routes</h4></div></div></div><p>
+                               The syntax for creating and deleting dynamic 
exchange routes is as follows:
+                       </p><pre class="screen">
+qpid-route [OPTIONS] dynamic add &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;exchange&gt; 
+qpid-route [OPTIONS] dynamic del &lt;dest-broker&gt; &lt;src-broker&gt; 
&lt;exchange&gt;
+</pre><p>
+                               In the following examples, we will route 
messages from a topic exchange. We will create a new topic exchange and 
federate it so that we are not affected by other all clients that use the 
built-in <span class="command"><strong>amq.topic</strong></span> exchange. The 
following commands create a new topic exchange on each of two brokers:
+                       </p><pre class="screen">
+$ qpid-config -a localhost:10003 add exchange topic fed.topic
+$ qpid-config -a localhost:10004 add exchange topic fed.topic
+</pre><p>
+                               Now let's create a dynamic exchange route that 
routes messages from the <span 
class="command"><strong>fed.topic</strong></span> exchange on the source broker 
<span class="command"><strong>localhost:10004</strong></span> to the <span 
class="command"><strong>fed.topic</strong></span> exchange on the destination 
broker <span class="command"><strong>localhost:10003</strong></span> if they 
match any binding on the destination broker's <span 
class="command"><strong>fed.topic</strong></span> exchange:
+                       </p><pre class="screen">
+$ qpid-route dynamic add localhost:10003 localhost:10004 fed.topic
+</pre><p>
+                               Internally, this creates a private autodelete 
queue on the source broker, and binds that queue to the <span 
class="command"><strong>fed.topic</strong></span> exchange on the source 
broker, using each binding associated with the <span 
class="command"><strong>fed.topic</strong></span> exchange on the destination 
broker.
+                       </p><p>
+                               In many applications, messages published to the 
destination exchange should also be routed to the source exchange. This is 
accomplished by creating a second dynamic exchange route, reversing the roles 
of the two exchanges:
+                       </p><pre class="screen">
+$ qpid-route dynamic add localhost:10004 localhost:10003 fed.topic
+</pre><p>
+                               If the <span 
class="command"><strong>-d</strong></span> option is specified, the exchange 
route is persistent, and will be restored if one or both of the brokers is 
restarted:
+                       </p><pre class="screen">
+$ qpid-route -d dynamic add localhost:10004 localhost:10003 fed.topic
+</pre><p>
+                               When an exchange route is durable, the private 
queue used to store messages for the route on the source exchange is also 
durable. If the connection between the brokers is lost, messages for the 
destination exchange continue to accumulate until it can be restored.
+                       </p><p>
+                               The <span 
class="command"><strong>del</strong></span> command takes the same arguments as 
the <span class="command"><strong>add</strong></span> command. The following 
command deletes the first exchange route described above:
+                       </p><pre class="screen">
+$ qpid-route dynamic del localhost:10004 localhost:10003 fed.topic
+</pre><p>
+                               Internally, this deletes the bindings on the 
source exchange for the the private queues associated with the message route.
+                       </p></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-The_qpid_route_Utility-Viewing_Routes"></a>1.4.4.5. Viewing
 Routes</h4></div></div></div><p>
+                               The <span class="command"><strong>route 
list</strong></span> command shows the routes associated with an individual 
broker. For instance, suppose we have created the following two routes:
+                       </p><pre class="screen">
+$ qpid-route dynamic add localhost:10003 localhost:10004 fed.topic
+$ qpid-route dynamic add localhost:10004 localhost:10003 fed.topic
+</pre><p>
+                               We can now use <span 
class="command"><strong>route list</strong></span> to show all routes for the 
broker <span class="command"><strong>localhost:10003</strong></span>:
+                       </p><pre class="screen">
+$ qpid-route route list localhost:10003
+localhost:10003 localhost:10004 fed.topic &lt;dynamic&gt;
+</pre><p>
+                               Note that this shows only one of the two routes 
we created, the route for which <span 
class="command"><strong>localhost:10003</strong></span> is a destination. If we 
want to see the route for which <span 
class="command"><strong>localhost:10004</strong></span> is a destination, we 
need to do another route list:
+                       </p><pre class="screen">
+$ qpid-route route list localhost:10004
+localhost:10004 localhost:10003 fed.topic &lt;dynamic&gt;
+</pre><p>
+                               The <span class="command"><strong>route 
map</strong></span> command shows all routes associated with a broker, and 
recursively displays all routes for brokers involved in federation 
relationships with the given broker. For instance, here is the output for the 
two brokers configured above:
+                       </p><pre class="screen">
+$ qpid-route route map localhost:10003
+
+Finding Linked Brokers:
+    localhost:10003... Ok
+    localhost:10004... Ok
+
+Dynamic Routes:
+
+  Exchange fed.topic:
+    localhost:10004 &lt;=&gt; localhost:10003
+
+Static Routes:
+  none found
+</pre><p>
+                               Note that the two dynamic exchange links are 
displayed as though they were one bidirectional link. The <span 
class="command"><strong>route map</strong></span> command is particularly 
helpful for larger, more complex networks. Let's configure a somewhat more 
complex network with 16 dynamic exchange routes:
+                       </p><pre class="screen">
+qpid-route dynamic add localhost:10001 localhost:10002 fed.topic
+qpid-route dynamic add localhost:10002 localhost:10001 fed.topic
+
+qpid-route dynamic add localhost:10003 localhost:10002 fed.topic
+qpid-route dynamic add localhost:10002 localhost:10003 fed.topic
+
+qpid-route dynamic add localhost:10004 localhost:10002 fed.topic
+qpid-route dynamic add localhost:10002 localhost:10004 fed.topic
+
+qpid-route dynamic add localhost:10002 localhost:10005 fed.topic
+qpid-route dynamic add localhost:10005 localhost:10002 fed.topic
+
+qpid-route dynamic add localhost:10005 localhost:10006 fed.topic
+qpid-route dynamic add localhost:10006 localhost:10005 fed.topic
+
+qpid-route dynamic add localhost:10006 localhost:10007 fed.topic
+qpid-route dynamic add localhost:10007 localhost:10006 fed.topic
+
+qpid-route dynamic add localhost:10006 localhost:10008 fed.topic
+qpid-route dynamic add localhost:10008 localhost:10006 fed.topic
+</pre><p>
+                               Now we can use <span 
class="command"><strong>route map</strong></span> starting with any one broker, 
and see the entire network:
+                       </p><pre class="screen">
+$ ./qpid-route route map localhost:10001
+
+Finding Linked Brokers:
+    localhost:10001... Ok
+    localhost:10002... Ok
+    localhost:10003... Ok
+    localhost:10004... Ok
+    localhost:10005... Ok
+    localhost:10006... Ok
+    localhost:10007... Ok
+    localhost:10008... Ok
+
+Dynamic Routes:
+
+  Exchange fed.topic:
+    localhost:10002 &lt;=&gt; localhost:10001
+    localhost:10003 &lt;=&gt; localhost:10002
+    localhost:10004 &lt;=&gt; localhost:10002
+    localhost:10005 &lt;=&gt; localhost:10002
+    localhost:10006 &lt;=&gt; localhost:10005
+    localhost:10007 &lt;=&gt; localhost:10006
+    localhost:10008 &lt;=&gt; localhost:10006
+
+Static Routes:
+  none found
+</pre></div><div class="section" lang="en"><div 
class="titlepage"><div><div><h4 class="title"><a 
name="sect-Messaging_User_Guide-The_qpid_route_Utility-Resilient_Connections"></a>1.4.4.6. Resilient
 Connections</h4></div></div></div><p>
+                               When a broker route is created, or when a 
durable broker route is restored after broker restart, a connection is created 
between the source broker and the destination broker. The connections used 
between brokers are called <em class="firstterm">resilient connections</em>; if 
the connection fails due to a communication error, it attempts to reconnect. 
The retry interval begins at 2 seconds and, as more attempts are made, grows to 
64 seconds, and continues to retry every 64 seconds thereafter. If the 
connection fails due to an authentication problem, it will not continue to 
retry.
+                       </p><p>
+                               The command <span class="command"><strong>list 
connections</strong></span> can be used to show the resilient connections for a 
broker:
+                       </p><pre class="screen">
+$ qpid-route list connections localhost:10001
+
+Host            Port    Transport Durable  State             Last Error
+=============================================================================
+localhost       10002   tcp          N     Operational       
+localhost       10003   tcp          N     Operational       
+localhost       10009   tcp          N     Waiting           Connection refused
+</pre><p>
+                               In the above output, <span 
class="command"><strong>Last Error</strong></span> contains the string 
representation of the last connection error received for the connection. <span 
class="command"><strong>State</strong></span> represents the state of the 
connection, and may be one of the following values:
+                       </p><div class="table"><a 
name="tabl-Messaging_User_Guide-Resilient_Connections-State_values_in_qpid_route_list_connections"></a><p
 class="title"><b>Table 1.3. State values in <span class="command">$ 
qpid-route list connections</span></b></p><div class="table-contents"><table 
summary="State values in $ qpid-route list connections" 
border="1"><colgroup><col><col></colgroup><tbody><tr><td align="left">
+                                                               Waiting
+                                                       </td><td align="left">
+                                                               Waiting before 
attempting to reconnect.
+                                                       </td></tr><tr><td 
align="left">
+                                                               Connecting
+                                                       </td><td align="left">
+                                                               Attempting to 
establish the connection.
+                                                       </td></tr><tr><td 
align="left">
+                                                               Operational
+                                                       </td><td align="left">
+                                                               The connection 
has been established and can be used.
+                                                       </td></tr><tr><td 
align="left">
+                                                               Failed
+                                                       </td><td align="left">
+                                                               The connection 
failed and will not retry (usually because authentication failed).
+                                                       </td></tr><tr><td 
align="left">
+                                                               Closed
+                                                       </td><td align="left">
+                                                               The connection 
has been closed and will soon be deleted.
+                                                       </td></tr><tr><td 
align="left">
+                                                               Passive
+                                                       </td><td align="left">
+                                                               If a cluster is 
federated to another cluster, only one of the nodes has an actual connection to 
remote node. Other nodes in the cluster have a passive connection.
+                                                       
</td></tr></tbody></table></div></div><br 
class="table-break"></div></div></div></div><div class="navfooter"><hr><table 
width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a 
accesskey="p" href="ch01s03.html">Prev</a> </td><td width="20%" 
align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" 
align="right"> <a accesskey="n" 
href="chap-Messaging_User_Guide-Security.html">Next</a></td></tr><tr><td 
width="40%" align="left" valign="top">1.3. 
+    Cheat Sheet for configuring Exchange Options
+   </td><td width="20%" align="center"><a accesskey="h" 
href="index.html">Home</a></td><td width="40%" align="right" 
valign="top"> 1.5. Security</td></tr></table></div><div 
class="main_text_area_bottom"></div></div></div></body></html>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to