Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 829DB200BFF for ; Mon, 12 Dec 2016 17:11:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 814EE160B3D; Mon, 12 Dec 2016 16:11:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BC412160B37 for ; Mon, 12 Dec 2016 17:11:24 +0100 (CET) Received: (qmail 3327 invoked by uid 500); 12 Dec 2016 16:11:24 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 3208 invoked by uid 99); 12 Dec 2016 16:11:23 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2016 16:11:23 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 5A5893A21B7 for ; Mon, 12 Dec 2016 16:11:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1002655 [7/47] - in /websites/production/activemq/content/artemis/docs/1.5.1: ./ diagrams/ gitbook/ gitbook/fonts/ gitbook/fonts/fontawesome/ gitbook/gitbook-plugin-fontsettings/ gitbook/gitbook-plugin-highlight/ gitbook/gitbook-plugin-lun... Date: Mon, 12 Dec 2016 16:11:21 -0000 To: commits@activemq.apache.org From: clebertsuconic@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161212161122.5A5893A21B7@svn01-us-west.apache.org> archived-at: Mon, 12 Dec 2016 16:11:26 -0000 Added: websites/production/activemq/content/artemis/docs/1.5.1/core-bridges.html ============================================================================== --- websites/production/activemq/content/artemis/docs/1.5.1/core-bridges.html (added) +++ websites/production/activemq/content/artemis/docs/1.5.1/core-bridges.html Mon Dec 12 16:11:17 2016 @@ -0,0 +1,1212 @@ + + + + + Core Bridges · ActiveMQ Artemis Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ +
+ +
+ + + + + + + + +
+
+ +
+
+ +
+ +

Core Bridges

+

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.

+

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.

+

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.

+

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.

+

Bridges can be configured to provide once and only once 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 Duplicate Detection).

+
+

Note

+

Although they have similar function, don't confuse core bridges with +JMS bridges!

+

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 once and only once 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.

+
+

Configuring Bridges

+

Bridges are configured in broker.xml. Let's kick off +with an example (this is actually from the bridge example):

+
<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>
+

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.

+

Let's take a look at all the parameters in turn:

+
    +
  • name attribute. All bridges must have a unique name in the server.

    +
  • +
  • queue-name. This is the unique name of the local queue that the +bridge consumes from, it's a mandatory parameter.

    +

    The queue must already exist by the time the bridge is instantiated +at start-up.

    +
    +

    Note

    +

    If you're using JMS then normally the JMS configuration +activemq-jms.xml is loaded after the core configuration file +broker.xml 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.

    +
    +
  • +
  • forwarding-address. 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.

    +
  • +
  • filter-string. 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 Filter Expressions.

    +
  • +
  • transformer-class-name. An optional transformer-class-name can be +specified. This is the name of a user-defined class which implements +the org.apache.activemq.artemis.core.server.cluster.Transformer interface.

    +

    If this is specified then the transformer's transform() 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.

    +
  • +
  • ha. 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 false.

    +
  • +
  • retry-interval. 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 +2000milliseconds.

    +
  • +
  • retry-interval-multiplier. This optional parameter determines +determines a multiplier to apply to the time since the last retry to +compute the time to the next retry.

    +

    This allows you to implement an exponential backoff between retry +attempts.

    +

    Let's take an example:

    +

    If we set retry-intervalto 1000 ms and we set +retry-interval-multiplier to 2.0, then, if the first reconnect +attempt fails, we will wait 1000 ms then 2000 ms then 4000 ms +between subsequent reconnection attempts.

    +

    The default value is 1.0 meaning each reconnect attempt is spaced +at equal intervals.

    +
  • +
  • initial-connect-attempts. This optional parameter determines the +total number of initial connect attempts the bridge will make before +giving up and shutting down. A value of -1 signifies an unlimited +number of attempts. The default value is -1.

    +
  • +
  • reconnect-attempts. This optional parameter determines the total +number of reconnect attempts the bridge will make before giving up +and shutting down. A value of -1 signifies an unlimited number of +attempts. The default value is -1.

    +
  • +
  • failover-on-server-shutdown. 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.

    +

    The bridge connector can specify both a live and a backup server, if +it specifies a backup server and this parameter is set to true +then if the target server is cleanly 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.

    +

    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.

    +

    The default value for this parameter is false.

    +
  • +
  • use-duplicate-detection. This optional parameter determines +whether the bridge will automatically insert a duplicate id property +into each message that it forwards.

    +

    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.

    +

    This allows the bridge to provide a once and only once delivery +guarantee without using heavyweight methods such as XA (see Duplicate Detection for +more information).

    +

    The default value for this parameter is true.

    +
  • +
  • confirmation-window-size. This optional parameter determines the +confirmation-window-size to use for the connection used to forward +messages to the target node. This attribute is described in section +Reconnection and Session Reattachment

    +
    +

    Warning

    +

    When using the bridge to forward messages to an address which uses +the BLOCK address-full-policy from a queue which has a +max-size-bytes set it's important that +confirmation-window-size is less than or equal to +max-size-bytes to prevent the flow of messages from ceasing.

    +
    +
  • +
  • producer-window-size. This optional parameter determines the +producer flow control through the bridge. You usually leave this off +unless you are dealing with huge large messages.

    +

    Default=-1 (disabled)

    +
  • +
  • user. 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 cluster-user in +broker.xml will be used.

    +
  • +
  • password. 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 +cluster-password in broker.xml will be used.

    +
  • +
  • static-connectors or discovery-group-ref. Pick either of these +options to connect the bridge to the target server.

    +

    The static-connectors is a list of connector-ref elements +pointing to connector elements defined elsewhere. A connector +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 Configuring the Transport.

    +

    The discovery-group-ref element has one attribute - +discovery-group-name. This attribute points to a discovery-group +defined elsewhere. For more information about what discovery-groups +are and how to configure them, please see Discovery Groups.

    +
  • +
+ + +
+ +
+
+
+ +

results matching ""

+
    + +
    +
    + +

    No results matching ""

    + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/architecture-diagrams.odg ============================================================================== Binary file - no diff available. Propchange: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/architecture-diagrams.odg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/ha-colocated.odg ============================================================================== Binary file - no diff available. Propchange: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/ha-colocated.odg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/ha-replicated-store.odg ============================================================================== Binary file - no diff available. Propchange: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/ha-replicated-store.odg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/ha-scaledown.odg ============================================================================== Binary file - no diff available. Propchange: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/ha-scaledown.odg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/ha-shared-store.odg ============================================================================== Binary file - no diff available. Propchange: websites/production/activemq/content/artemis/docs/1.5.1/diagrams/ha-shared-store.odg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: websites/production/activemq/content/artemis/docs/1.5.1/diverts.html ============================================================================== --- websites/production/activemq/content/artemis/docs/1.5.1/diverts.html (added) +++ websites/production/activemq/content/artemis/docs/1.5.1/diverts.html Mon Dec 12 16:11:17 2016 @@ -0,0 +1,1102 @@ + + + + + Diverting and Splitting Message Flows · ActiveMQ Artemis Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + +
    + +
    + +
    + + + + + + + + +
    +
    + +
    +
    + +
    + +

    Diverting and Splitting Message Flows

    +

    Apache ActiveMQ Artemis allows you to configure objects called diverts with some +simple server configuration.

    +

    Diverts allow you to transparently divert messages routed to one address +to some other address, without making any changes to any client +application logic.

    +

    Diverts can be exclusive, meaning that the message is diverted to the +new address, and does not go to the old address at all, or they can be +non-exclusive which means the message continues to go the old address, +and a copy of it is also sent to the new address. Non-exclusive +diverts can therefore be used for splitting message flows, e.g. there +may be a requirement to monitor every order sent to an order queue.

    +

    Diverts can also be configured to have an optional message filter. If +specified then only messages that match the filter will be diverted.

    +

    When an address has both exclusive and non-exclusive diverts configured, +the exclusive ones are processed first. If any of the exclusive diverts +diverted the message, the non-exclusive ones are not processed.

    +

    Diverts can also be configured to apply a Transformer. If specified, +all diverted messages will have the opportunity of being transformed by +the Transformer. When an address has multiple diverts configured, all +of them receive the same, original message. This means that the results +of a transformer on a message are not directly available for other +diverts or their filters on the same address.

    +

    A divert will only divert a message to an address on the same server, +however, if you want to divert to an address on a different server, a +common pattern would be to divert to a local store-and-forward queue, +then set up a bridge which consumes from that queue and forwards to an +address on a different server.

    +

    Diverts are therefore a very sophisticated concept, which when combined +with bridges can be used to create interesting and complex routings. The +set of diverts on a server can be thought of as a type of routing table +for messages. Combining diverts with bridges allows you to create a +distributed network of reliable routing connections between multiple +geographically distributed servers, creating your global messaging mesh.

    +

    Diverts are defined as xml in the broker.xml file. +There can be zero or more diverts in the file.

    +

    Please see the examples for a full working example showing you how to +configure and use diverts.

    +

    Let's take a look at some divert examples:

    +

    Exclusive Divert

    +

    Let's take a look at an exclusive divert. An exclusive divert diverts +all matching messages that are routed to the old address to the new +address. Matching messages do not get routed to the old address.

    +

    Here's some example xml configuration for an exclusive divert, it's +taken from the divert example:

    +
    <divert name="prices-divert">
    +   <address>jms.topic.priceUpdates</address>
    +   <forwarding-address>jms.queue.priceForwarding</forwarding-address>
    +   <filter string="office='New York'"/>
    +   <transformer-class-name>
    +      org.apache.activemq.artemis.jms.example.AddForwardingTimeTransformer
    +   </transformer-class-name>
    +   <exclusive>true</exclusive>
    +</divert>
    +

    We define a divert called 'prices-divert' that will divert any +messages sent to the address 'jms.topic.priceUpdates' (this +corresponds to any messages sent to a JMS Topic called 'priceUpdates') +to another local address 'jms.queue.priceForwarding' (this corresponds +to a local JMS queue called 'priceForwarding'

    +

    We also specify a message filter string so only messages with the +message property office with value New York will get diverted, all +other messages will continue to be routed to the normal address. The +filter string is optional, if not specified then all messages will be +considered matched.

    +

    In this example a transformer class is specified. Again this is +optional, and if specified the transformer will be executed for each +matching message. This allows you to change the messages body or +properties before it is diverted. In this example the transformer simply +adds a header that records the time the divert happened.

    +

    This example is actually diverting messages to a local store and forward +queue, which is configured with a bridge which forwards the message to +an address on another ActiveMQ Artemis server. Please see the example for more +details.

    +

    Non-exclusive Divert

    +

    Now we'll take a look at a non-exclusive divert. Non exclusive diverts +are the same as exclusive diverts, but they only forward a copy of the +message to the new address. The original message continues to the old +address

    +

    You can therefore think of non-exclusive diverts as splitting a +message flow.

    +

    Non exclusive diverts can be configured in the same way as exclusive +diverts with an optional filter and transformer, here's an example +non-exclusive divert, again from the divert example:

    +
    <divert name="order-divert">
    +    <address>jms.queue.orders</address>
    +    <forwarding-address>jms.topic.spyTopic</forwarding-address>
    +    <exclusive>false</exclusive>
    +</divert>
    +

    The above divert example takes a copy of every message sent to the +address 'jms.queue.orders' (Which corresponds to a JMS Queue called +'orders') and sends it to a local address called +'jms.topic.SpyTopic' (which corresponds to a JMS Topic called +'SpyTopic').

    + + +
    + +
    +
    +
    + +

    results matching ""

    +
      + +
      +
      + +

      No results matching ""

      + +
      +
      +
      + +
      +
      + +
      + + + + + + + + + + + + + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +