Bug 999344 - Document - How to configure JMS bridges
Document - How to configure JMS bridges
Status: CLOSED DUPLICATE of bug 964099
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: HornetQ, Documentation (Show other bugs)
6.1.1
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Russell Dickenson
Russell Dickenson
Russell Dickenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-21 04:16 EDT by Miroslav Novak
Modified: 2014-10-25 08:17 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-05 02:54:03 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Miroslav Novak 2013-08-21 04:16:06 EDT
Hi,

we're missing description and example configuration of JMS bridges for EAP 6.x.x.

Information about JMS bridges can be found in HornetQ project documentation [1] (Do not confuse it with HornetQ core bridges. This is similar but not the same thing.)

Example configuration:

<subsystem xmlns="urn:jboss:domain:messaging:1.3">
            <hornetq-server>
               ...
            </hornetq-server>
            <jms-bridge name="myBridge">
                <source>
                    <connection-factory name="java:/ConnectionFactory"/>
                    <destination name="jms/queue/InQueue"/>
                </source>
                <target>
                    <connection-factory name="jms/RemoteConnectionFactory"/>
                    <destination name="jms/queue/OutQueue"/>
                    <context>
                        <property key="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/>
                        <property key="java.naming.provider.url" value="remote://<IP_of_target_server>:4447"/>
                    </context>
                </target>
                <quality-of-service>ONCE_AND_ONLY_ONCE</quality-of-service>
                <failure-retry-interval>1000</failure-retry-interval>
                <max-retries>-1</max-retries>
                <max-batch-size>10</max-batch-size>
                <max-batch-time>100</max-batch-time>
                <add-messageID-in-header>true</add-messageID-in-header>
            </jms-bridge>
        </subsystem>

Make sure that all attributes are documented, especially attribute quality-of-service.

Following attributes can be configured for JMS bridges (taken from CLI):
  "add-messageID-in-header" => true,
        "client-id" => undefined,
        "failure-retry-interval" => 1000L,
        "max-batch-size" => 10,
        "max-batch-time" => 100L,
        "max-retries" => -1,
        "module" => undefined,
        "quality-of-service" => "ONCE_AND_ONLY_ONCE",
        "selector" => undefined,
        "source-connection-factory" => "java:/ConnectionFactory",
        "source-context" => undefined,
        "source-destination" => "jms/queue/InQueue",
        "source-password" => undefined,
        "source-user" => undefined,
        "subscription-name" => undefined,
        "target-connection-factory" => "jms/RemoteConnectionFactory",
        "target-context" => {
            "java.naming.factory.initial" => "org.jboss.naming.remote.client.InitialContextFactory",
            "java.naming.provider.url" => "remote://192.168.40.1:4447"
        },
        "target-destination" => "jms/queue/OutQueue",
        "target-password" => undefined,
        "target-user" => undefined

Link to HornetQ project documentation:
[1] http://docs.jboss.org/hornetq/2.3.0.Final/docs/user-manual/html_single/index.html#jms-bridge
Comment 1 Miroslav Novak 2013-08-21 04:19:27 EDT
CLI is providing info about each attribute which could be useful:

[standalone@192.168.40.3:9999 jms-bridge=myBridge] :read-resource-description
{
    "outcome" => "success",
    "result" => {
        "description" => "A JMS bridge instance.",
        "attributes" => {
            "selector" => {
                "type" => STRING,
                "description" => "A JMS selector expression used for consuming messages from the source destination. Only messages that match the selector expression will be bridged from the source to the target destination.",
                "expressions-allowed" => true,
                "nillable" => true,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "all-services"
            },
            "failure-retry-interval" => {
                "type" => LONG,
                "description" => "The amount of time in milliseconds to wait between trying to recreate connections to the source or target servers when the bridge has detected they have failed.",
                "expressions-allowed" => true,
                "nillable" => false,
                "unit" => "MILLISECONDS",
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "source-destination" => {
                "type" => STRING,
                "description" => "The name of the source destination to lookup on the source messaging server.",
                "expressions-allowed" => false,
                "nillable" => false,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "quality-of-service" => {
                "type" => STRING,
                "description" => "The desired quality of service mode (AT_MOST_ONCE, DUPLICATES_OK or ONCE_AND_ONLY_ONCE).",
                "expressions-allowed" => true,
                "nillable" => false,
                "allowed" => [
                    "AT_MOST_ONCE",
                    "DUPLICATES_OK",
                    "ONCE_AND_ONLY_ONCE"
                ],
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "target-password" => {
                "type" => STRING,
                "description" => "The password for creating the target connection.",
                "expressions-allowed" => true,
                "nillable" => true,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "max-batch-size" => {
                "type" => INT,
                "description" => "The maximum number of messages to consume from the source destination before sending them in a batch to the target destination. Its value must >= 1.",
                "expressions-allowed" => true,
                "nillable" => false,
                "min" => 0L,
                "max" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "max-retries" => {
                "type" => INT,
                "description" => "The number of times to attempt to recreate connections to the source or target servers when the bridge has detected they have failed. The bridge will give up after trying this number of times. -1 represents 'try forever'.",
                "expressions-allowed" => true,
                "nillable" => false,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "client-id" => {
                "type" => STRING,
                "description" => "The JMS client ID to use when creating/looking up the subscription if it is durable and the source destination is a topic.",
                "expressions-allowed" => true,
                "nillable" => true,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "source-password" => {
                "type" => STRING,
                "description" => "The password for creating the source connection.",
                "expressions-allowed" => true,
                "nillable" => true,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "target-connection-factory" => {
                "type" => STRING,
                "description" => "The name of the target connection factory to lookup on the target messaging server.",
                "expressions-allowed" => false,
                "nillable" => false,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "target-destination" => {
                "type" => STRING,
                "description" => "The name of the target destination to lookup on the target messaging server.",
                "expressions-allowed" => false,
                "nillable" => false,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "module" => {
                "type" => STRING,
                "description" => "The name of AS7 module containing the resources required to lookup source and target JMS resources.",
                "expressions-allowed" => false,
                "nillable" => true,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "source-context" => {
                "type" => OBJECT,
                "description" => "he properties used to configure the source JNDI initial context.",
                "expressions-allowed" => true,
                "nillable" => true,
                "value-type" => STRING,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "paused" => {
                "type" => BOOLEAN,
                "description" => "Whether the JMS bridge is paused.",
                "expressions-allowed" => false,
                "nillable" => false,
                "access-type" => "read-only",
                "storage" => "runtime"
            },
            "source-connection-factory" => {
                "type" => STRING,
                "description" => "The name of the source connection factory to lookup on the source messaging server.",
                "expressions-allowed" => false,
                "nillable" => false,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "add-messageID-in-header" => {
                "type" => BOOLEAN,
                "description" => "If true, then the original message's message ID will be appended in the message sent to the destination in the header HORNETQ_BRIDGE_MSG_ID_LIST. If the message is bridged more than once, each message ID will be appended.",
                "expressions-allowed" => true,
                "nillable" => true,
                "default" => false,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "source-user" => {
                "type" => STRING,
                "description" => "The name of the user for creating the source connection.",
                "expressions-allowed" => true,
                "nillable" => true,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "target-user" => {
                "type" => STRING,
                "description" => "The name of the user for creating the target connection.",
                "expressions-allowed" => true,
                "nillable" => true,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "subscription-name" => {
                "type" => STRING,
                "description" => "The name of the subscription if it is durable and the source destination is a topic.",
                "expressions-allowed" => true,
                "nillable" => true,
                "min-length" => 1L,
                "max-length" => 2147483647L,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "max-batch-time" => {
                "type" => LONG,
                "description" => "The maximum number of milliseconds to wait before sending a batch to target, even if the number of messages consumed has not reached max-batch-size. Its value must be -1 to represent 'wait forever', or >= 1 to specify an actual time.",
                "expressions-allowed" => true,
                "nillable" => false,
                "unit" => "MILLISECONDS",
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            },
            "started" => {
                "type" => BOOLEAN,
                "description" => "Whether the JMS bridge is started.",
                "expressions-allowed" => false,
                "nillable" => false,
                "access-type" => "read-only",
                "storage" => "runtime"
            },
            "target-context" => {
                "type" => OBJECT,
                "description" => "The properties used to configure the target JNDI initial context.",
                "expressions-allowed" => true,
                "nillable" => true,
                "value-type" => STRING,
                "access-type" => "read-write",
                "storage" => "configuration",
                "restart-required" => "no-services"
            }
        },
        "operations" => undefined,
        "children" => {}
    }
}
Comment 2 Jeff Mesnil 2013-08-21 04:26:08 EDT
AS7.2 documentation contains doc about configuring JMS bridges: https://docs.jboss.org/author/display/AS72/Messaging+configuration
Comment 7 Miroslav Novak 2013-10-21 06:32:37 EDT
If target and source is HornetQ then module attribute "org.hornetq" must be specified otherwise JMS bridge can fail to connect. Example:

<jms-bridge name="myBridge" module="org.hornetq">
   ...
</jms-bridge>
Comment 8 Martin Svehla 2014-02-05 02:54:03 EST

*** This bug has been marked as a duplicate of bug 964099 ***

Note You need to log in before you can comment on or make changes to this bug.