blob: 035a8362f9cd1083616fe60457e5901ff681681b [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Address Federation ยท ActiveMQ Artemis Documentation</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="federation-queue.html" />
<link rel="prev" href="federation.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="./">
<a href="./">
Introduction
</a>
</li>
<li class="chapter " data-level="1.2" data-path="notice.html">
<a href="notice.html">
Legal Notice
</a>
</li>
<li class="chapter " data-level="1.3" data-path="preface.html">
<a href="preface.html">
Preface
</a>
</li>
<li class="chapter " data-level="1.4" data-path="project-info.html">
<a href="project-info.html">
Project Info
</a>
</li>
<li class="chapter " data-level="1.5" data-path="versions.html">
<a href="versions.html">
Versions
</a>
</li>
<li class="chapter " data-level="1.6" data-path="messaging-concepts.html">
<a href="messaging-concepts.html">
Messaging Concepts
</a>
</li>
<li class="chapter " data-level="1.7" data-path="architecture.html">
<a href="architecture.html">
Architecture
</a>
</li>
<li class="chapter " data-level="1.8" data-path="using-server.html">
<a href="using-server.html">
Using the Server
</a>
</li>
<li class="chapter " data-level="1.9" data-path="upgrading.html">
<a href="upgrading.html">
Upgrading
</a>
</li>
<li class="chapter " data-level="1.10" data-path="address-model.html">
<a href="address-model.html">
Address Model
</a>
</li>
<li class="chapter " data-level="1.11" data-path="protocols-interoperability.html">
<a href="protocols-interoperability.html">
Protocols and Interoperability
</a>
</li>
<li class="chapter " data-level="1.12" data-path="amqp.html">
<a href="amqp.html">
AMQP
</a>
</li>
<li class="chapter " data-level="1.13" data-path="mqtt.html">
<a href="mqtt.html">
MQTT
</a>
</li>
<li class="chapter " data-level="1.14" data-path="stomp.html">
<a href="stomp.html">
STOMP
</a>
</li>
<li class="chapter " data-level="1.15" data-path="openwire.html">
<a href="openwire.html">
OpenWire
</a>
</li>
<li class="chapter " data-level="1.16" data-path="core.html">
<a href="core.html">
Core
</a>
</li>
<li class="chapter " data-level="1.17" data-path="jms-core-mapping.html">
<a href="jms-core-mapping.html">
Mapping JMS Concepts to the Core API
</a>
</li>
<li class="chapter " data-level="1.18" data-path="using-jms.html">
<a href="using-jms.html">
Using JMS
</a>
</li>
<li class="chapter " data-level="1.19" data-path="client-classpath.html">
<a href="client-classpath.html">
The Client Classpath
</a>
</li>
<li class="chapter " data-level="1.20" data-path="examples.html">
<a href="examples.html">
Examples
</a>
</li>
<li class="chapter " data-level="1.21" data-path="wildcard-routing.html">
<a href="wildcard-routing.html">
Routing Messages With Wild Cards
</a>
</li>
<li class="chapter " data-level="1.22" data-path="wildcard-syntax.html">
<a href="wildcard-syntax.html">
Wildcard Syntax
</a>
</li>
<li class="chapter " data-level="1.23" data-path="filter-expressions.html">
<a href="filter-expressions.html">
Filter Expressions
</a>
</li>
<li class="chapter " data-level="1.24" data-path="persistence.html">
<a href="persistence.html">
Persistence
</a>
</li>
<li class="chapter " data-level="1.25" data-path="configuring-transports.html">
<a href="configuring-transports.html">
Configuring Transports
</a>
</li>
<li class="chapter " data-level="1.26" data-path="config-reload.html">
<a href="config-reload.html">
Configuration Reload
</a>
</li>
<li class="chapter " data-level="1.27" data-path="connection-ttl.html">
<a href="connection-ttl.html">
Detecting Dead Connections
</a>
</li>
<li class="chapter " data-level="1.28" data-path="slow-consumers.html">
<a href="slow-consumers.html">
Detecting Slow Consumers
</a>
</li>
<li class="chapter " data-level="1.29" data-path="network-isolation.html">
<a href="network-isolation.html">
Avoiding Network Isolation
</a>
</li>
<li class="chapter " data-level="1.30" data-path="critical-analysis.html">
<a href="critical-analysis.html">
Detecting Broker Issues (Critical Analysis)
</a>
</li>
<li class="chapter " data-level="1.31" data-path="transaction-config.html">
<a href="transaction-config.html">
Resource Manager Configuration
</a>
</li>
<li class="chapter " data-level="1.32" data-path="flow-control.html">
<a href="flow-control.html">
Flow Control
</a>
</li>
<li class="chapter " data-level="1.33" data-path="send-guarantees.html">
<a href="send-guarantees.html">
Guarantees of sends and commits
</a>
</li>
<li class="chapter " data-level="1.34" data-path="undelivered-messages.html">
<a href="undelivered-messages.html">
Message Redelivery and Undelivered Messages
</a>
</li>
<li class="chapter " data-level="1.35" data-path="message-expiry.html">
<a href="message-expiry.html">
Message Expiry
</a>
</li>
<li class="chapter " data-level="1.36" data-path="large-messages.html">
<a href="large-messages.html">
Large Messages
</a>
</li>
<li class="chapter " data-level="1.37" data-path="paging.html">
<a href="paging.html">
Paging
</a>
</li>
<li class="chapter " data-level="1.38" data-path="scheduled-messages.html">
<a href="scheduled-messages.html">
Scheduled Messages
</a>
</li>
<li class="chapter " data-level="1.39" data-path="last-value-queues.html">
<a href="last-value-queues.html">
Last-Value Queues
</a>
</li>
<li class="chapter " data-level="1.40" data-path="ring-queues.html">
<a href="ring-queues.html">
Ring Queues
</a>
</li>
<li class="chapter " data-level="1.41" data-path="retroactive-addresses.html">
<a href="retroactive-addresses.html">
Retroactive Addresses
</a>
</li>
<li class="chapter " data-level="1.42" data-path="exclusive-queues.html">
<a href="exclusive-queues.html">
Exclusive Queues
</a>
</li>
<li class="chapter " data-level="1.43" data-path="message-grouping.html">
<a href="message-grouping.html">
Message Grouping
</a>
</li>
<li class="chapter " data-level="1.44" data-path="consumer-priority.html">
<a href="consumer-priority.html">
Consumer Priority
</a>
</li>
<li class="chapter " data-level="1.45" data-path="pre-acknowledge.html">
<a href="pre-acknowledge.html">
Extra Acknowledge Modes
</a>
</li>
<li class="chapter " data-level="1.46" data-path="management.html">
<a href="management.html">
Management
</a>
</li>
<li class="chapter " data-level="1.47" data-path="management-console.html">
<a href="management-console.html">
Management Console
</a>
</li>
<li class="chapter " data-level="1.48" data-path="metrics.html">
<a href="metrics.html">
Metrics
</a>
</li>
<li class="chapter " data-level="1.49" data-path="security.html">
<a href="security.html">
Security
</a>
</li>
<li class="chapter " data-level="1.50" data-path="masking-passwords.html">
<a href="masking-passwords.html">
Masking Passwords
</a>
</li>
<li class="chapter " data-level="1.51" data-path="broker-plugins.html">
<a href="broker-plugins.html">
Broker Plugins
</a>
</li>
<li class="chapter " data-level="1.52" data-path="resource-limits.html">
<a href="resource-limits.html">
Resource Limits
</a>
</li>
<li class="chapter " data-level="1.53" data-path="jms-bridge.html">
<a href="jms-bridge.html">
The JMS Bridge
</a>
</li>
<li class="chapter " data-level="1.54" data-path="client-reconnection.html">
<a href="client-reconnection.html">
Client Reconnection and Session Reattachment
</a>
</li>
<li class="chapter " data-level="1.55" data-path="diverts.html">
<a href="diverts.html">
Diverting and Splitting Message Flows
</a>
</li>
<li class="chapter " data-level="1.56" data-path="core-bridges.html">
<a href="core-bridges.html">
Core Bridges
</a>
</li>
<li class="chapter " data-level="1.57" data-path="transformers.html">
<a href="transformers.html">
Transformers
</a>
</li>
<li class="chapter " data-level="1.58" data-path="duplicate-detection.html">
<a href="duplicate-detection.html">
Duplicate Message Detection
</a>
</li>
<li class="chapter " data-level="1.59" data-path="clusters.html">
<a href="clusters.html">
Clusters
</a>
</li>
<li class="chapter " data-level="1.60" data-path="federation.html">
<a href="federation.html">
Federation
</a>
<ul class="articles">
<li class="chapter active" data-level="1.60.1" data-path="federation-address.html">
<a href="federation-address.html">
Address Federation
</a>
</li>
<li class="chapter " data-level="1.60.2" data-path="federation-queue.html">
<a href="federation-queue.html">
Queue Federation
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.61" data-path="ha.html">
<a href="ha.html">
High Availability and Failover
</a>
</li>
<li class="chapter " data-level="1.62" data-path="graceful-shutdown.html">
<a href="graceful-shutdown.html">
Graceful Server Shutdown
</a>
</li>
<li class="chapter " data-level="1.63" data-path="libaio.html">
<a href="libaio.html">
Libaio Native Libraries
</a>
</li>
<li class="chapter " data-level="1.64" data-path="thread-pooling.html">
<a href="thread-pooling.html">
Thread management
</a>
</li>
<li class="chapter " data-level="1.65" data-path="web-server.html">
<a href="web-server.html">
Embedded Web Server
</a>
</li>
<li class="chapter " data-level="1.66" data-path="logging.html">
<a href="logging.html">
Logging
</a>
</li>
<li class="chapter " data-level="1.67" data-path="rest.html">
<a href="rest.html">
REST Interface
</a>
</li>
<li class="chapter " data-level="1.68" data-path="embedding-activemq.html">
<a href="embedding-activemq.html">
Embedding the Broker
</a>
</li>
<li class="chapter " data-level="1.69" data-path="karaf.html">
<a href="karaf.html">
Apache Karaf
</a>
</li>
<li class="chapter " data-level="1.70" data-path="tomcat.html">
<a href="tomcat.html">
Apache Tomcat
</a>
</li>
<li class="chapter " data-level="1.71" data-path="spring-integration.html">
<a href="spring-integration.html">
Spring Integration
</a>
</li>
<li class="chapter " data-level="1.72" data-path="cdi-integration.html">
<a href="cdi-integration.html">
CDI Integration
</a>
</li>
<li class="chapter " data-level="1.73" data-path="intercepting-operations.html">
<a href="intercepting-operations.html">
Intercepting Operations
</a>
</li>
<li class="chapter " data-level="1.74" data-path="data-tools.html">
<a href="data-tools.html">
Data Tools
</a>
</li>
<li class="chapter " data-level="1.75" data-path="maven-plugin.html">
<a href="maven-plugin.html">
Maven Plugin
</a>
</li>
<li class="chapter " data-level="1.76" data-path="unit-testing.html">
<a href="unit-testing.html">
Unit Testing
</a>
</li>
<li class="chapter " data-level="1.77" data-path="perf-tuning.html">
<a href="perf-tuning.html">
Troubleshooting and Performance Tuning
</a>
</li>
<li class="chapter " data-level="1.78" data-path="configuration-index.html">
<a href="configuration-index.html">
Configuration Reference
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="." >Address Federation</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="address-federation">Address Federation</h1>
<h2 id="introduction">Introduction</h2>
<p>Address federation is like full multicast over the connected brokers, in that every message sent to address
on <code>Broker-A</code> will be delivered to every queue on that broker, but like wise will be delivered to <code>Broker-B</code>
and all attached queues there.</p>
<p>Address federation dynamically links to other addresses in upstream or downstream brokers. It automatically creates a queue on the remote address for itself,
to which then it consumes, copying to the local address, as though they were published directly to it. </p>
<p>The upstream brokers do not need to be reconfigured or the address, simply permissions to the address need to be
given to the address for the downstream broker. Similarly the same applies for downstream configurations.</p>
<p><img src="images/federation-address.png" alt="Address Federation">
Figure 1. Address Federation</p>
<h2 id="topology-patterns">Topology Patterns</h2>
<h3 id="symmetric">Symmetric</h3>
<p><img src="images/federation-address-symetric.png" alt="Address Federation">
Figure 2. Address Federation - Symmetric</p>
<p>As seen above, a publisher and consumer are connected to each broker.
Queues and thus consumers on those queues, can receive messages published by either publisher.</p>
<p>It is important in this setup to set <code>max-hops=1</code> to so that messages are copied only one and avoid cyclic replication.
If <code>max-hops</code> is not configured correctly, consumers will get multiple copies of the same message.</p>
<h3 id="full-mesh">Full Mesh</h3>
<p><img src="images/federation-address-complete-graph.png" alt="Address Federation">
Figure 3. Address Federation - Full Mesh</p>
<p>If not already spotted, the setup is identical to symemtric but simply where all brokers are symmetrically federating each other, creating a full mesh.</p>
<p>As illustrated, a publisher and consumer are connected to each broker.
Queues and thus consumers on those queues, can receive messages published by either publisher.</p>
<p>As with symmetric setup, it is important in this setup to set <code>max-hops=1</code> to so that messages are copied only one and avoid cyclic replication.
If <code>max-hops</code> is not configured correctly, consumers will get multiple copies of the same message.</p>
<h3 id="ring">Ring</h3>
<p><img src="images/federation-address-ring.png" alt="Address Federation">
Figure 4. Address Federation - Symmetric</p>
<p>In a ring of brokers each federated address is <code>upstream</code> to just one other in the ring. To avoid the cyclic issue,
it is important to set <code>max-hops</code> to <code>n - 1</code> where <code>n</code> is the number of nodes in the ring.
e.g. in the example above property is set to 5 so that every address in the ring sees the message exactly once.</p>
<p>Whilst this setup is cheap in regards to connections, it is brittle, in that if a single broker fails, the ring fails.</p>
<h3 id="fan-out">Fan out</h3>
<p><img src="images/federation-address-fan-out.png" alt="Address Federation">
Figure 5. Address Federation - Fan Out</p>
<p>One master address (it would required no configuration) is linked to by a tree of downstream federated addresses,
the tree can extend to any depth, and can be extended to without needing to re-configure existing brokers. </p>
<p>In this case messages published to the master address can be received by any consumer connected to any broker in the tree.</p>
<h2 id="configuring-address-federation">Configuring Address Federation</h2>
<p>Federation is configured in <code>broker.xml</code>.</p>
<p>Sample Address Federation setup:</p>
<pre><code>&lt;federations&gt;
&lt;federation name=&quot;eu-north-1&quot; user=&quot;federation_username&quot; password=&quot;32a10275cf4ab4e9&quot;&gt;
&lt;upstream name=&quot;eu-east-1&quot;&gt;
&lt;static-connectors&gt;
&lt;connector-ref&gt;eu-east-connector1&lt;/connector-ref&gt;
&lt;connector-ref&gt;eu-east-connector1&lt;/connector-ref&gt;
&lt;/static-connectors&gt;
&lt;policy ref=&quot;news-address-federation&quot;/&gt;
&lt;/upstream&gt;
&lt;upstream name=&quot;eu-west-1&quot; &gt;
&lt;static-connectors&gt;
&lt;connector-ref&gt;eu-west-connector1&lt;/connector-ref&gt;
&lt;connector-ref&gt;eu-west-connector1&lt;/connector-ref&gt;
&lt;/static-connectors&gt;
&lt;policy ref=&quot;news-address-federation&quot;/&gt;
&lt;/upstream&gt;
&lt;address-policy name=&quot;news-address-federation&quot; max-hops=&quot;1&quot; auto-delete=&quot;true&quot; auto-delete-delay=&quot;300000&quot; auto-delete-message-count=&quot;-1&quot; transformer-ref=&quot;federation-transformer-3&quot;&gt;
&lt;include address-match=&quot;queue.bbc.new&quot; /&gt;
&lt;include address-match=&quot;queue.usatoday&quot; /&gt;
&lt;include address-match=&quot;queue.news.#&quot; /&gt;
&lt;exclude address-match=&quot;queue.news.sport.#&quot; /&gt;
&lt;/address-policy&gt;
&lt;transformer name=&quot;news-transformer&quot;&gt;
&lt;class-name&gt;org.foo.NewsTransformer&lt;/class-name&gt;
&lt;property key=&quot;key1&quot; value=&quot;value1&quot;/&gt;
&lt;property key=&quot;key2&quot; value=&quot;value2&quot;/&gt;
&lt;/transformer&gt;
&lt;/federation&gt;
&lt;/federations&gt;
</code></pre><p>In the above setup downstream broker <code>eu-north-1</code> is configured to connect to two upstream brokers <code>eu-east-1</code> and <code>eu-east-2</code>, the credentials used for both connections to both brokers in this sample are shared, you can set user and password at the upstream level should they be different per upstream.</p>
<p>Both upstreams are configured with the same address-policy <code>news-address-federation</code>, that is selecting addresses which match any of the include criteria, but will exclude anything that starts <code>queue.news.sport</code>.</p>
<p><strong>It is important that federation name is globally unique.</strong></p>
<p>Let&apos;s take a look at all the <code>address-policy</code> parameters in turn, in order of priority.</p>
<ul>
<li><p><code>name</code> attribute. All address-policies must have a unique name in the server.</p>
</li>
<li><p><code>include</code> the address-match pattern to whitelist addresses, multiple of these can be set. If none are set all addresses are matched.</p>
</li>
<li><p><code>exclude</code> the address-match pattern to blacklist addresses, multiple of these can be set.</p>
</li>
<li><p><code>max-hops</code>. The number of hops that a message can have made for it to be federated, see <a href="#topology-patterns">Topology Patterns</a> above for more details.</p>
</li>
<li><p><code>auto-delete</code>. For address federation, the downstream dynamically creates a durable queue on the upstream address. This is used to mark if the upstream queue should be deleted once downstream disconnects,
and the delay and message count params have been met. This is useful if you want to automate the clean up, though you may wish to disable this if you want messages to queued for the downstream when disconnect no matter what.</p>
</li>
<li><p><code>auto-delete-delay</code>. The amount of time in milliseconds after the downstream broker has disconnected before the upstream queue can be eligable for <code>auto-delete</code>.</p>
</li>
<li><p><code>auto-delete-message-count</code>. The amount number messages in the upstream queue that the message count must be equal or below before the downstream broker has disconnected before the upstream queue can be eligable for <code>auto-delete</code>.</p>
</li>
<li><p><code>transformer-ref</code>. The ref name for a transformer (see transformer config) that you may wish to configure to transform the message on federation transfer.</p>
</li>
</ul>
<p><strong>note</strong> <code>address-policy</code>&apos;s and <code>queue-policy</code>&apos;s are able to be defined in the same federation, and be linked to the same upstream.</p>
<p>Now look at all the <code>transformer</code> parameters in turn, in order of priority:</p>
<ul>
<li><p><code>name</code> attribute. This must be a unique name in the server, and is used to ref the transformer in <code>address-policy</code> and <code>queue-policy</code></p>
</li>
<li><p><code>transformer-class-name</code>. An optional transformer-class-name can be
specified. This is the name of a user-defined class which implements the
<code>org.apache.activemq.artemis.core.server.transformer.Transformer</code> interface.</p>
<p>If this is specified then the transformer&apos;s <code>transform()</code> method will be
invoked with the message before it is transferred. This gives you the opportunity
to transform the message&apos;s header or body before it is federated.</p>
</li>
<li><p><code>property</code> holds key, value pairs that can be used to configure the transformer.</p>
</li>
</ul>
<p>Finally look at <code>upstream</code>, this is what defines the upstream broker connection and the policies to use against it.</p>
<ul>
<li><p><code>name</code> attribute. This must be a unique name in the server, and is used to ref the transformer in <code>address-policy</code> and <code>queue-policy</code></p>
</li>
<li><p><code>user</code>. This optional attribute determines the user name to use when creating
the upstream connection to the remote server. If it is not specified the shared
federation user and password will be used if set.</p>
</li>
<li><p><code>password</code>. This optional attribute determines the password to use when
creating the upstream connection to the remote server. If it is not specified the shared
federation user and password will be used if set.</p>
</li>
<li><p><code>static-connectors</code> or <code>discovery-group-ref</code>. Pick either of these options to
connect the bridge to the target server.</p>
<p>The <code>static-connectors</code> is a list of <code>connector-ref</code> elements pointing to
<code>connector</code> elements defined elsewhere. A <em>connector</em> encapsulates knowledge of
what transport to use (TCP, SSL, HTTP etc) as well as the server connection
parameters (host, port etc). For more information about what connectors are and
how to configure them, please see <a href="configuring-transports.html">Configuring the
Transport</a>.</p>
<p>The <code>discovery-group-ref</code> element has one attribute - <code>discovery-group-name</code>.
This attribute points to a <code>discovery-group</code> defined elsewhere. For more
information about what discovery-groups are and how to configure them, please
see <a href="clusters.html">Discovery Groups</a>.</p>
</li>
<li><p><code>ha</code>. This optional parameter determines whether or not this bridge should
support high availability. True means it will connect to any available server
in a cluster and support failover. The default value is <code>false</code>.</p>
</li>
<li><p><code>circuit-breaker-timeout</code> in milliseconds, When a connection issue occurs,
as the single connection is shared by many federated queue and address consumers,
to avoid each one trying to reconnect and possibly causing a thundering heard issue,
the first one will try, if unsuccessful the circuit breaker will open,
returning the same exception to all, this is the timeout until the circuit can be closed and connection retried.</p>
</li>
<li><p><code>share-connection</code>. If there is a downstream and upstream connection configured for the same broker then
the same connection will be shared as long as both stream configs set this flag to true.
Default is false.</p>
</li>
<li><p><code>check-period</code>. The period (in milliseconds) used to check if the
federation connection has failed to receive pings from another server.
Default is 30000.</p>
</li>
<li><p><code>connection-ttl</code>. This is how long a federation connection should stay
alive if it stops receiving messages from the remote broker. Default is 60000.</p>
</li>
<li><p><code>call-timeout</code>. When a packet is sent via a federation connection and
is a blocking call, i.e. for acknowledgements, this is how long it
will wait (in milliseconds) for the reply before throwing an
exception. Default is 30000.</p>
</li>
<li><p><code>call-failover-timeout</code>. Similar to <code>call-timeout</code> but used when a
call is made during a failover attempt. Default is -1 (no timeout).</p>
</li>
<li><p><code>retry-interval</code>. This optional parameter determines the period in
milliseconds between subsequent reconnection attempts, if the connection to
the target server has failed. The default value is <code>500</code> milliseconds.</p>
</li>
<li><p><code>retry-interval-multiplier</code>. This is a multiplier used to increase
the <code>retry-interval</code> after each reconnect attempt, default is 1.</p>
</li>
<li><p><code>max-retry-interval</code>. The maximum delay (in milliseconds) for
retries. Default is 2000.</p>
</li>
<li><p><code>initial-connect-attempts</code>. The number of times the system will try
to connect to the remote broker in the federation. If the max-retry is
achieved this broker will be considered permanently down and the
system will not route messages to this broker. Default is -1 (infinite
retries).</p>
</li>
<li><p><code>reconnect-attempts</code>. The number of times the system will try to
reconnect to the remote broker in the federation. If the max-retry is achieved
this broker will be considered permanently down and the system will
stop routing messages to this broker. Default is -1 (infinite
retries).</p>
</li>
</ul>
<h2 id="configuring-downstream-federation">Configuring Downstream Federation</h2>
<p>Similarly to <code>upstream</code> configuration, a downstream configuration can be configured. This works by sending a command
to the <code>downstream</code> broker to have it create an <code>upstream</code> connection back to the downstream broker. The benefit of
this is being able to configure everything for federation on one broker in some cases to make it easier, such
as a hub and spoke topology</p>
<p>All of the same configuration options apply to to <code>downstream</code> as does <code>upstream</code> with the exception of one
extra configuration flag that needs to be set:</p>
<p> The <code>transport-connector-ref</code> is an element pointing to a
<code>connector</code> elements defined elsewhere. This ref is used to tell the downstream broker
what connector to use to create a new upstream connection back to the downstream broker.</p>
<p> A <em>connector</em> encapsulates knowledge of what transport to use (TCP, SSL, HTTP etc) as well as
the server connection parameters (host, port etc). For more information about what connectors are and
how to configure them, please see <a href="configuring-transports.html">Configuring the
Transport</a>.</p>
<p>Sample Downstream Address Federation setup:</p>
<pre><code class="lang-xml">
<span class="hljs-comment">&lt;!--Other config Here --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">connectors</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">connector</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;netty-connector&quot;</span>&gt;</span>tcp://localhost:61616<span class="hljs-tag">&lt;/<span class="hljs-name">connector</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">connector</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;eu-west-1-connector&quot;</span>&gt;</span>tcp://localhost:61616<span class="hljs-tag">&lt;/<span class="hljs-name">connector</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">connector</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;eu-east-1-connector&quot;</span>&gt;</span>tcp://localhost:61617<span class="hljs-tag">&lt;/<span class="hljs-name">connector</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">connectors</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">acceptors</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">acceptor</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;netty-acceptor&quot;</span>&gt;</span>tcp://localhost:61616<span class="hljs-tag">&lt;/<span class="hljs-name">acceptor</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">acceptors</span>&gt;</span>
<span class="hljs-comment">&lt;!--Other config Here --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">federations</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">federation</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;eu-north-1&quot;</span> <span class="hljs-attr">user</span>=<span class="hljs-string">&quot;federation_username&quot;</span> <span class="hljs-attr">password</span>=<span class="hljs-string">&quot;32a10275cf4ab4e9&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">downstream</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;eu-east-1&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">static-connectors</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">connector-ref</span>&gt;</span>eu-east-connector1<span class="hljs-tag">&lt;/<span class="hljs-name">connector-ref</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">static-connectors</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">transport-connector-ref</span>&gt;</span>netty-connector<span class="hljs-tag">&lt;/<span class="hljs-name">transport-connector-ref</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">policy</span> <span class="hljs-attr">ref</span>=<span class="hljs-string">&quot;news-address-federation&quot;</span>/&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">downstream</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">downstream</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;eu-west-1&quot;</span> &gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">static-connectors</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">connector-ref</span>&gt;</span>eu-west-connector1<span class="hljs-tag">&lt;/<span class="hljs-name">connector-ref</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">static-connectors</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">transport-connector-ref</span>&gt;</span>netty-connector<span class="hljs-tag">&lt;/<span class="hljs-name">transport-connector-ref</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">policy</span> <span class="hljs-attr">ref</span>=<span class="hljs-string">&quot;news-address-federation&quot;</span>/&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">downstream</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">address-policy</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;news-address-federation&quot;</span> <span class="hljs-attr">max-hops</span>=<span class="hljs-string">&quot;1&quot;</span> <span class="hljs-attr">auto-delete</span>=<span class="hljs-string">&quot;true&quot;</span> <span class="hljs-attr">auto-delete-delay</span>=<span class="hljs-string">&quot;300000&quot;</span> <span class="hljs-attr">auto-delete-message-count</span>=<span class="hljs-string">&quot;-1&quot;</span> <span class="hljs-attr">transformer-ref</span>=<span class="hljs-string">&quot;federation-transformer-3&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">include</span> <span class="hljs-attr">address-match</span>=<span class="hljs-string">&quot;queue.bbc.new&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">include</span> <span class="hljs-attr">address-match</span>=<span class="hljs-string">&quot;queue.usatoday&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">include</span> <span class="hljs-attr">address-match</span>=<span class="hljs-string">&quot;queue.news.#&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">exclude</span> <span class="hljs-attr">address-match</span>=<span class="hljs-string">&quot;queue.news.sport.#&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">address-policy</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">transformer</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;news-transformer&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">class-name</span>&gt;</span>org.foo.NewsTransformer<span class="hljs-tag">&lt;/<span class="hljs-name">class-name</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">property</span> <span class="hljs-attr">key</span>=<span class="hljs-string">&quot;key1&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;value1&quot;</span>/&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">property</span> <span class="hljs-attr">key</span>=<span class="hljs-string">&quot;key2&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;value2&quot;</span>/&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">transformer</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">federation</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">federations</span>&gt;</span>
</code></pre>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="federation.html" class="navigation navigation-prev " aria-label="Previous page: Federation">
<i class="fa fa-angle-left"></i>
</a>
<a href="federation-queue.html" class="navigation navigation-next " aria-label="Next page: Queue Federation">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Address Federation","level":"1.60.1","depth":2,"next":{"title":"Queue Federation","level":"1.60.2","depth":2,"path":"federation-queue.md","ref":"federation-queue.md","articles":[]},"previous":{"title":"Federation","level":"1.60","depth":1,"path":"federation.md","ref":"federation.md","articles":[{"title":"Address Federation","level":"1.60.1","depth":2,"path":"federation-address.md","ref":"federation-address.md","articles":[]},{"title":"Queue Federation","level":"1.60.2","depth":2,"path":"federation-queue.md","ref":"federation-queue.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"github":"apache/activemq-artemis","theme":"default","githubHost":"https://github.com/","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"ActiveMQ Artemis Documentation","links":{"home":"http://activemq.apache.org/artemis","issues":"https://issues.apache.org/jira/browse/ARTEMIS","contribute":"http://activemq.apache.org/contributing.html"},"gitbook":"3.x.x","description":"ActiveMQ Artemis User Guide and Reference Documentation"},"file":{"path":"federation-address.md","mtime":"2020-01-10T14:13:27.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-01-10T14:51:01.535Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>
<script src="gitbook/gitbook.js"></script>
<script src="gitbook/theme.js"></script>
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="gitbook/gitbook-plugin-search/search.js"></script>
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>