| <!DOCTYPE HTML> |
| <html lang="en" > |
| |
| <head> |
| |
| <meta charset="UTF-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| <title>Core Bridges | ActiveMQ Artemis Documentation</title> |
| <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> |
| <meta name="description" content=""> |
| <meta name="generator" content="GitBook 2.1.0"> |
| |
| |
| <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="stylesheet" href="gitbook/style.css"> |
| |
| |
| |
| |
| |
| |
| <link rel="next" href="./duplicate-detection.html" /> |
| |
| |
| <link rel="prev" href="./diverts.html" /> |
| |
| |
| |
| </head> |
| <body> |
| |
| |
| <div class="book" data-level="37" data-basepath="." data-revision="Wed Jun 08 2016 13:05:37 GMT+0100 (BST)"> |
| |
| |
| <div class="book-summary"> |
| <div class="book-search"> |
| <input type="text" placeholder="Type to search" class="form-control" /> |
| </div> |
| <ul class="summary"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <li class="chapter " data-level="0" data-path="index.html"> |
| |
| |
| <a href="./index.html"> |
| <i class="fa fa-check"></i> |
| |
| Introduction |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1" data-path="notice.html"> |
| |
| |
| <a href="./notice.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>1.</b> |
| |
| Legal Notice |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="2" data-path="preface.html"> |
| |
| |
| <a href="./preface.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>2.</b> |
| |
| Preface |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="3" data-path="project-info.html"> |
| |
| |
| <a href="./project-info.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>3.</b> |
| |
| Project Info |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="4" data-path="messaging-concepts.html"> |
| |
| |
| <a href="./messaging-concepts.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>4.</b> |
| |
| Messaging Concepts |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="5" data-path="architecture.html"> |
| |
| |
| <a href="./architecture.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>5.</b> |
| |
| Architecture |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="6" data-path="using-server.html"> |
| |
| |
| <a href="./using-server.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>6.</b> |
| |
| Using the Server |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="7" data-path="using-jms.html"> |
| |
| |
| <a href="./using-jms.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>7.</b> |
| |
| Using JMS |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="8" data-path="using-core.html"> |
| |
| |
| <a href="./using-core.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>8.</b> |
| |
| Using Core |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="9" data-path="jms-core-mapping.html"> |
| |
| |
| <a href="./jms-core-mapping.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>9.</b> |
| |
| Mapping JMS Concepts to the Core API |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="10" data-path="client-classpath.html"> |
| |
| |
| <a href="./client-classpath.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>10.</b> |
| |
| The Client Classpath |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="11" data-path="examples.html"> |
| |
| |
| <a href="./examples.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>11.</b> |
| |
| Examples |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="12" data-path="wildcard-routing.html"> |
| |
| |
| <a href="./wildcard-routing.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>12.</b> |
| |
| Routing Messages With Wild Cards |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="13" data-path="wildcard-syntax.html"> |
| |
| |
| <a href="./wildcard-syntax.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>13.</b> |
| |
| Understanding the Apache ActiveMQ Artemis Wildcard Syntax |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="14" data-path="filter-expressions.html"> |
| |
| |
| <a href="./filter-expressions.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>14.</b> |
| |
| Filter Expressions |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="15" data-path="persistence.html"> |
| |
| |
| <a href="./persistence.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>15.</b> |
| |
| Persistence |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="16" data-path="configuring-transports.html"> |
| |
| |
| <a href="./configuring-transports.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>16.</b> |
| |
| Configuring Transports |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="17" data-path="connection-ttl.html"> |
| |
| |
| <a href="./connection-ttl.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>17.</b> |
| |
| Detecting Dead Connections |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="18" data-path="slow-consumers.html"> |
| |
| |
| <a href="./slow-consumers.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>18.</b> |
| |
| Detecting Slow Consumers |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="19" data-path="transaction-config.html"> |
| |
| |
| <a href="./transaction-config.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>19.</b> |
| |
| Resource Manager Configuration |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="20" data-path="flow-control.html"> |
| |
| |
| <a href="./flow-control.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>20.</b> |
| |
| Flow Control |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="21" data-path="send-guarantees.html"> |
| |
| |
| <a href="./send-guarantees.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>21.</b> |
| |
| Guarantees of sends and commits |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="22" data-path="undelivered-messages.html"> |
| |
| |
| <a href="./undelivered-messages.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>22.</b> |
| |
| Message Redelivery and Undelivered Messages |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="23" data-path="message-expiry.html"> |
| |
| |
| <a href="./message-expiry.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>23.</b> |
| |
| Message Expiry |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="24" data-path="large-messages.html"> |
| |
| |
| <a href="./large-messages.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>24.</b> |
| |
| Large Messages |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="25" data-path="paging.html"> |
| |
| |
| <a href="./paging.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>25.</b> |
| |
| Paging |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="26" data-path="queue-attributes.html"> |
| |
| |
| <a href="./queue-attributes.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>26.</b> |
| |
| Queue Attributes |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="27" data-path="scheduled-messages.html"> |
| |
| |
| <a href="./scheduled-messages.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>27.</b> |
| |
| Scheduled Messages |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="28" data-path="last-value-queues.html"> |
| |
| |
| <a href="./last-value-queues.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>28.</b> |
| |
| Last-Value Queues |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="29" data-path="message-grouping.html"> |
| |
| |
| <a href="./message-grouping.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>29.</b> |
| |
| Message Grouping |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="30" data-path="pre-acknowledge.html"> |
| |
| |
| <a href="./pre-acknowledge.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>30.</b> |
| |
| Extra Acknowledge Modes |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="31" data-path="management.html"> |
| |
| |
| <a href="./management.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>31.</b> |
| |
| Management |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="32" data-path="security.html"> |
| |
| |
| <a href="./security.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>32.</b> |
| |
| Security |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="33" data-path="resource-limits.html"> |
| |
| |
| <a href="./resource-limits.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>33.</b> |
| |
| Resource Limits |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="34" data-path="jms-bridge.html"> |
| |
| |
| <a href="./jms-bridge.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>34.</b> |
| |
| The JMS Bridge |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="35" data-path="client-reconnection.html"> |
| |
| |
| <a href="./client-reconnection.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>35.</b> |
| |
| Client Reconnection and Session Reattachment |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="36" data-path="diverts.html"> |
| |
| |
| <a href="./diverts.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>36.</b> |
| |
| Diverting and Splitting Message Flows |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter active" data-level="37" data-path="core-bridges.html"> |
| |
| |
| <a href="./core-bridges.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>37.</b> |
| |
| Core Bridges |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="38" data-path="duplicate-detection.html"> |
| |
| |
| <a href="./duplicate-detection.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>38.</b> |
| |
| Duplicate Message Detection |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="39" data-path="clusters.html"> |
| |
| |
| <a href="./clusters.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>39.</b> |
| |
| Clusters |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="40" data-path="ha.html"> |
| |
| |
| <a href="./ha.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>40.</b> |
| |
| High Availability and Failover |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="41" data-path="graceful-shutdown.html"> |
| |
| |
| <a href="./graceful-shutdown.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>41.</b> |
| |
| Graceful Server Shutdown |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="42" data-path="libaio.html"> |
| |
| |
| <a href="./libaio.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>42.</b> |
| |
| Libaio Native Libraries |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="43" data-path="thread-pooling.html"> |
| |
| |
| <a href="./thread-pooling.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>43.</b> |
| |
| Thread management |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="44" data-path="logging.html"> |
| |
| |
| <a href="./logging.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>44.</b> |
| |
| Logging |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="45" data-path="rest.html"> |
| |
| |
| <a href="./rest.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>45.</b> |
| |
| REST Interface |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="46" data-path="embedding-activemq.html"> |
| |
| |
| <a href="./embedding-activemq.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>46.</b> |
| |
| Embedding Apache ActiveMQ Artemis |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="47" data-path="karaf.html"> |
| |
| |
| <a href="./karaf.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>47.</b> |
| |
| Apache Karaf |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="48" data-path="spring-integration.html"> |
| |
| |
| <a href="./spring-integration.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>48.</b> |
| |
| Spring Integration |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="49" data-path="aerogear-integration.html"> |
| |
| |
| <a href="./aerogear-integration.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>49.</b> |
| |
| AeroGear Integration |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="50" data-path="vertx-integration.html"> |
| |
| |
| <a href="./vertx-integration.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>50.</b> |
| |
| VertX Integration |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="51" data-path="intercepting-operations.html"> |
| |
| |
| <a href="./intercepting-operations.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>51.</b> |
| |
| Intercepting Operations |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="52" data-path="protocols-interoperability.html"> |
| |
| |
| <a href="./protocols-interoperability.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>52.</b> |
| |
| Protocols and Interoperability |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="53" data-path="tools.html"> |
| |
| |
| <a href="./tools.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>53.</b> |
| |
| Tools |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="54" data-path="maven-plugin.html"> |
| |
| |
| <a href="./maven-plugin.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>54.</b> |
| |
| Maven Plugin |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="55" data-path="perf-tuning.html"> |
| |
| |
| <a href="./perf-tuning.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>55.</b> |
| |
| Troubleshooting and Performance Tuning |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="56" data-path="configuration-index.html"> |
| |
| |
| <a href="./configuration-index.html"> |
| <i class="fa fa-check"></i> |
| |
| <b>56.</b> |
| |
| 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> |
| </div> |
| |
| <div class="book-body"> |
| <div class="body-inner"> |
| <div class="book-header"> |
| <!-- Actions Left --> |
| <a href="#" class="btn pull-left toggle-summary" aria-label="Table of Contents"><i class="fa fa-align-justify"></i></a> |
| <a href="#" class="btn pull-left toggle-search" aria-label="Search"><i class="fa fa-search"></i></a> |
| |
| <div id="font-settings-wrapper" class="dropdown pull-left"> |
| <a href="#" class="btn toggle-dropdown" aria-label="Font Settings"><i class="fa fa-font"></i> |
| </a> |
| <div class="dropdown-menu font-settings"> |
| <div class="dropdown-caret"> |
| <span class="caret-outer"></span> |
| <span class="caret-inner"></span> |
| </div> |
| |
| <div class="buttons"> |
| <button type="button" id="reduce-font-size" class="button size-2">A</button> |
| <button type="button" id="enlarge-font-size" class="button size-2">A</button> |
| </div> |
| |
| <div class="buttons font-family-list"> |
| <button type="button" data-font="0" class="button">Serif</button> |
| <button type="button" data-font="1" class="button">Sans</button> |
| </div> |
| |
| <div class="buttons color-theme-list"> |
| <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button> |
| <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button> |
| <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button> |
| </div> |
| </div> |
| |
| </div> |
| |
| <!-- Actions Right --> |
| |
| <div class="dropdown pull-right"> |
| <a href="#" class="btn toggle-dropdown" aria-label="Share"><i class="fa fa-share-alt"></i> |
| </a> |
| <div class="dropdown-menu font-settings dropdown-left"> |
| <div class="dropdown-caret"> |
| <span class="caret-outer"></span> |
| <span class="caret-inner"></span> |
| </div> |
| <div class="buttons"> |
| <button type="button" data-sharing="twitter" class="button"> |
| Share on Twitter |
| </button> |
| <button type="button" data-sharing="google-plus" class="button"> |
| Share on Google |
| </button> |
| <button type="button" data-sharing="facebook" class="button"> |
| Share on Facebook |
| </button> |
| <button type="button" data-sharing="weibo" class="button"> |
| Share on Weibo |
| </button> |
| <button type="button" data-sharing="instapaper" class="button"> |
| Share on Instapaper |
| </button> |
| </div> |
| </div> |
| </div> |
| |
| |
| |
| <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a> |
| |
| |
| <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a> |
| |
| |
| <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a> |
| |
| |
| |
| |
| |
| <!-- Title --> |
| <h1> |
| <i class="fa fa-circle-o-notch fa-spin"></i> |
| <a href="./" >ActiveMQ Artemis Documentation</a> |
| </h1> |
| </div> |
| |
| <div class="page-wrapper" tabindex="-1"> |
| <div class="page-inner"> |
| |
| |
| <section class="normal" id="section-"> |
| |
| <h1 id="core-bridges">Core Bridges</h1> |
| <p>The function of a bridge is to consume messages from a source queue, and |
| forward them to a target address, typically on a different Apache ActiveMQ Artemis |
| server.</p> |
| <p>The source and target servers do not have to be in the same cluster |
| which makes bridging suitable for reliably sending messages from one |
| cluster to another, for instance across a WAN, or internet and where the |
| connection may be unreliable.</p> |
| <p>The bridge has built in resilience to failure so if the target server |
| connection is lost, e.g. due to network failure, the bridge will retry |
| connecting to the target until it comes back online. When it comes back |
| online it will resume operation as normal.</p> |
| <p>In summary, bridges are a way to reliably connect two separate Apache ActiveMQ Artemis |
| servers together. With a core bridge both source and target servers must |
| be Apache ActiveMQ Artemis servers.</p> |
| <p>Bridges can be configured to provide <em>once and only once</em> delivery |
| guarantees even in the event of the failure of the source or the target |
| server. They do this by using duplicate detection (described in <a href="duplicate-detection.html">Duplicate Detection</a>).</p> |
| <blockquote> |
| <p><strong>Note</strong></p> |
| <p>Although they have similar function, don't confuse core bridges with |
| JMS bridges!</p> |
| <p>Core bridges are for linking an Apache ActiveMQ Artemis node with another Apache ActiveMQ Artemis |
| node and do not use the JMS API. A JMS Bridge is used for linking any |
| two JMS 1.1 compliant JMS providers. So, a JMS Bridge could be used |
| for bridging to or from different JMS compliant messaging system. It's |
| always preferable to use a core bridge if you can. Core bridges use |
| duplicate detection to provide <em>once and only once</em> guarantees. To |
| provide the same guarantee using a JMS bridge you would have to use XA |
| which has a higher overhead and is more complex to configure.</p> |
| </blockquote> |
| <h2 id="configuring-bridges">Configuring Bridges</h2> |
| <p>Bridges are configured in <code>broker.xml</code>. Let's kick off |
| with an example (this is actually from the bridge example):</p> |
| <pre><code><bridge name="my-bridge"> |
| <queue-name>jms.queue.sausage-factory</queue-name> |
| <forwarding-address>jms.queue.mincing-machine</forwarding-address> |
| <filter-string="name='aardvark'"/> |
| <transformer-class-name> |
| org.apache.activemq.artemis.jms.example.HatColourChangeTransformer |
| </transformer-class-name> |
| <retry-interval>1000</retry-interval> |
| <ha>true</ha> |
| <retry-interval-multiplier>1.0</retry-interval-multiplier> |
| <initial-connect-attempts>-1</initial-connect-attempts> |
| <reconnect-attempts>-1</reconnect-attempts> |
| <failover-on-server-shutdown>false</failover-on-server-shutdown> |
| <use-duplicate-detection>true</use-duplicate-detection> |
| <confirmation-window-size>10000000</confirmation-window-size> |
| <user>foouser</user> |
| <password>foopassword</password> |
| <static-connectors> |
| <connector-ref>remote-connector</connector-ref> |
| </static-connectors> |
| <!-- alternative to static-connectors |
| <discovery-group-ref discovery-group-name="bridge-discovery-group"/> |
| --> |
| </bridge> |
| </code></pre><p>In the above example we have shown all the parameters its possible to |
| configure for a bridge. In practice you might use many of the defaults |
| so it won't be necessary to specify them all explicitly.</p> |
| <p>Let's take a look at all the parameters in turn:</p> |
| <ul> |
| <li><p><code>name</code> attribute. All bridges must have a unique name in the server.</p> |
| </li> |
| <li><p><code>queue-name</code>. This is the unique name of the local queue that the |
| bridge consumes from, it's a mandatory parameter.</p> |
| <p>The queue must already exist by the time the bridge is instantiated |
| at start-up.</p> |
| <blockquote> |
| <p><strong>Note</strong></p> |
| <p>If you're using JMS then normally the JMS configuration |
| <code>activemq-jms.xml</code> is loaded after the core configuration file |
| <code>broker.xml</code> is loaded. If your bridge is |
| consuming from a JMS queue then you'll need to make sure the JMS |
| queue is also deployed as a core queue in the core configuration. |
| Take a look at the bridge example for an example of how this is |
| done.</p> |
| </blockquote> |
| </li> |
| <li><p><code>forwarding-address</code>. This is the address on the target server that |
| the message will be forwarded to. If a forwarding address is not |
| specified, then the original address of the message will be |
| retained.</p> |
| </li> |
| <li><p><code>filter-string</code>. An optional filter string can be supplied. If |
| specified then only messages which match the filter expression |
| specified in the filter string will be forwarded. The filter string |
| follows the ActiveMQ Artemis filter expression syntax described in <a href="filter-expressions.html">Filter Expressions</a>.</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.cluster.Transformer</code> interface.</p> |
| <p>If this is specified then the transformer's <code>transform()</code> method |
| will be invoked with the message before it is forwarded. This gives |
| you the opportunity to transform the message's header or body before |
| forwarding it.</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>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>2000</code>milliseconds.</p> |
| </li> |
| <li><p><code>retry-interval-multiplier</code>. This optional parameter determines |
| determines a multiplier to apply to the time since the last retry to |
| compute the time to the next retry.</p> |
| <p>This allows you to implement an <em>exponential backoff</em> between retry |
| attempts.</p> |
| <p>Let's take an example:</p> |
| <p>If we set <code>retry-interval</code>to <code>1000</code> ms and we set |
| <code>retry-interval-multiplier</code> to <code>2.0</code>, then, if the first reconnect |
| attempt fails, we will wait <code>1000</code> ms then <code>2000</code> ms then <code>4000</code> ms |
| between subsequent reconnection attempts.</p> |
| <p>The default value is <code>1.0</code> meaning each reconnect attempt is spaced |
| at equal intervals.</p> |
| </li> |
| <li><p><code>initial-connect-attempts</code>. This optional parameter determines the |
| total number of initial connect attempts the bridge will make before |
| giving up and shutting down. A value of <code>-1</code> signifies an unlimited |
| number of attempts. The default value is <code>-1</code>.</p> |
| </li> |
| <li><p><code>reconnect-attempts</code>. This optional parameter determines the total |
| number of reconnect attempts the bridge will make before giving up |
| and shutting down. A value of <code>-1</code> signifies an unlimited number of |
| attempts. The default value is <code>-1</code>.</p> |
| </li> |
| <li><p><code>failover-on-server-shutdown</code>. This optional parameter determines |
| whether the bridge will attempt to failover onto a backup server (if |
| specified) when the target server is cleanly shutdown rather than |
| crashed.</p> |
| <p>The bridge connector can specify both a live and a backup server, if |
| it specifies a backup server and this parameter is set to <code>true</code> |
| then if the target server is <em>cleanly</em> shutdown the bridge |
| connection will attempt to failover onto its backup. If the bridge |
| connector has no backup server configured then this parameter has no |
| effect.</p> |
| <p>Sometimes you want a bridge configured with a live and a backup |
| target server, but you don't want to failover to the backup if the |
| live server is simply taken down temporarily for maintenance, this |
| is when this parameter comes in handy.</p> |
| <p>The default value for this parameter is <code>false</code>.</p> |
| </li> |
| <li><p><code>use-duplicate-detection</code>. This optional parameter determines |
| whether the bridge will automatically insert a duplicate id property |
| into each message that it forwards.</p> |
| <p>Doing so, allows the target server to perform duplicate detection on |
| messages it receives from the source server. If the connection fails |
| or server crashes, then, when the bridge resumes it will resend |
| unacknowledged messages. This might result in duplicate messages |
| being sent to the target server. By enabling duplicate detection |
| allows these duplicates to be screened out and ignored.</p> |
| <p>This allows the bridge to provide a <em>once and only once</em> delivery |
| guarantee without using heavyweight methods such as XA (see <a href="duplicate-detection.html">Duplicate Detection</a> for |
| more information).</p> |
| <p>The default value for this parameter is <code>true</code>.</p> |
| </li> |
| <li><p><code>confirmation-window-size</code>. This optional parameter determines the |
| <code>confirmation-window-size</code> to use for the connection used to forward |
| messages to the target node. This attribute is described in section |
| <a href="client-reconnection.html">Reconnection and Session Reattachment</a></p> |
| <blockquote> |
| <p><strong>Warning</strong></p> |
| <p>When using the bridge to forward messages to an address which uses |
| the <code>BLOCK</code> <code>address-full-policy</code> from a queue which has a |
| <code>max-size-bytes</code> set it's important that |
| <code>confirmation-window-size</code> is less than or equal to |
| <code>max-size-bytes</code> to prevent the flow of messages from ceasing.</p> |
| </blockquote> |
| </li> |
| <li><p><code>producer-window-size</code>. This optional parameter determines the |
| producer flow control through the bridge. You usually leave this off |
| unless you are dealing with huge large messages. </p> |
| <p>Default=-1 (disabled)</p> |
| </li> |
| <li><p><code>user</code>. This optional parameter determines the user name to use when |
| creating the bridge connection to the remote server. If it is not |
| specified the default cluster user specified by <code>cluster-user</code> in |
| <code>broker.xml</code> will be used.</p> |
| </li> |
| <li><p><code>password</code>. This optional parameter determines the password to use |
| when creating the bridge connection to the remote server. If it is |
| not specified the default cluster password specified by |
| <code>cluster-password</code> in <code>broker.xml</code> will be used.</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> |
| </ul> |
| |
| |
| </section> |
| |
| |
| </div> |
| </div> |
| </div> |
| |
| |
| <a href="./diverts.html" class="navigation navigation-prev " aria-label="Previous page: Diverting and Splitting Message Flows"><i class="fa fa-angle-left"></i></a> |
| |
| |
| <a href="./duplicate-detection.html" class="navigation navigation-next " aria-label="Next page: Duplicate Message Detection"><i class="fa fa-angle-right"></i></a> |
| |
| </div> |
| </div> |
| |
| |
| <script src="gitbook/app.js"></script> |
| |
| <script> |
| require(["gitbook"], function(gitbook) { |
| var config = {"fontSettings":{"theme":null,"family":"sans","size":2}}; |
| gitbook.start(config); |
| }); |
| </script> |
| |
| |
| </body> |
| |
| </html> |