4 Replies Latest reply on Mar 8, 2007 12:49 PM by Tim Fox

    Message bridge

    Karl de Boer Newbie

      According to the 1.2 GA User Guide a messaging bridge is included.
      However i cannot find any documentation how to set this up.
      Is it included or will this be a feature of 1.2.1?
      I have tried to make a bridge myself (in 1.2 CR1) using an MDB in JBoss 405 and two JCA Connectionfactories (one local and one remote) but got stuck in classloading issues and class cast exceptions.


      Karl




        • 1. Re: Message bridge
          Tim Fox Master

          Yes, 1.2 GA includes a fully functioning message bridge, although it's not currently included in the documentation due to time constraints on the 1.2 release. We will remedy this shortly.

          It's pretty straightforward to setup. Basically it's installed as an MBean. Here's the xmbean description from the distro:

          <?xml version="1.0" encoding="UTF-8"?>
           <!DOCTYPE mbean PUBLIC
           "-//JBoss//DTD JBOSS XMBEAN 1.2//EN"
           "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_2.dtd">
          
          <mbean>
           <description>A JMS Message Bridge</description>
           <class>org.jboss.server.bridge.BridgeService</class>
          
           <!-- Managed constructors -->
          
           <!-- Managed attributes -->
          
           <attribute access="read-only" getMethod="getInstance">
           <description>Gets the underlying instance</description>
           <name>Instance</name>
           <type>org.jboss.messaging.core.plugin.contract.MessagingComponent</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getSourceProviderAdaptorLookup"
           setMethod="setSourceProviderAdaptorLookup">
           <description>JNDI lookup for the source JMS provider Adaptor</description>
           <name>SourceProviderAdaptorLookup</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getTargetProviderAdaptorLookup"
           setMethod="setTargetProviderAdaptorLookup">
           <description>JNDI lookup for the target JMS provider Adaptor</description>
           <name>TargetProviderAdaptorLookup</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getSourceDestinationLookup"
           setMethod="setSourceDestinationLookup">
           <description>The source destination lookup</description>
           <name>SourceDestinationLookup</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getTargetDestinationLookup"
           setMethod="setTargetDestinationLookup">
           <description>The target destination lookup</description>
           <name>TargetDestinationLookup</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getSourceUsername"
           setMethod="setSourceUsername">
           <description>The source username</description>
           <name>SourceUsername</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getSourcePassword"
           setMethod="setSourcePassword">
           <description>The source username</description>
           <name>SourcePassword</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getTargetUsername"
           setMethod="setTargetUsername">
           <description>The target username</description>
           <name>TargetUsername</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getTargetPassword"
           setMethod="setTargetPassword">
           <description>The target password</description>
           <name>TargetPassword</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getQualityOfServiceMode"
           setMethod="setQualityOfServiceMode">
           <description>The quality of service mode. 0 = at most once. 1 = duplicates ok, 2 = once and only once</description>
           <name>QualityOfServiceMode</name>
           <type>int</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getSelector"
           setMethod="setSelector">
           <description>The JMS selector to use when consuming messages from the source destination</description>
           <name>Selector</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getMaxBatchSize"
           setMethod="setMaxBatchSize">
           <description>The maximum number of messages to forward at a time, must be >= 1</description>
           <name>MaxBatchSize</name>
           <type>int</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getMaxBatchTime"
           setMethod="setMaxBatchTime">
           <description>Number of milliseconds to wait after no messages arrive to forward batch of messages</description>
           <name>MaxBatchTime</name>
           <type>long</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getSubName"
           setMethod="setSubName">
           <description>If consuming from a durable subscription, this is the name of the durable subscrition</description>
           <name>SubName</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getClientID"
           setMethod="setClientID">
           <description>If consuming from a durable subscription, this is the client id to use</description>
           <name>ClientID</name>
           <type>java.lang.String</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getFailureRetryInterval"
           setMethod="setFailureRetryInterval">
           <description>The amount of time to wait in milliseconds before retrying connection creation, after connection failure is detected, or -1 if no retries will be attempted</description>
           <name>FailureRetryInterval</name>
           <type>long</type>
           </attribute>
          
           <attribute access="read-write" getMethod="getMaxRetries"
           setMethod="setMaxRetries">
           <description>The maximum number of attempts to retry connection creation after connection failure is detected</description>
           <name>MaxRetries</name>
           <type>int</type>
           </attribute>
          
           <attribute access="read-only" getMethod="isFailed">
           <description>Has the bridge failed?</description>
           <name>Failed</name>
           <type>boolean</type>
           </attribute>
          
           <attribute access="read-only" getMethod="isPaused">
           <description>Is the bridge paused?</description>
           <name>Paused</name>
           <type>boolean</type>
           </attribute>
          
           <attribute access="read-only" getMethod="isStarted">
           <description>Is the bridge started?</description>
           <name>Started</name>
           <type>boolean</type>
           </attribute>
          
           <!-- Managed operations -->
          
           <operation>
           <description>JBoss Service lifecycle operation</description>
           <name>create</name>
           </operation>
          
           <operation>
           <description>JBoss Service lifecycle operation</description>
           <name>start</name>
           </operation>
          
           <operation>
           <description>JBoss Service lifecycle operation</description>
           <name>stop</name>
           </operation>
          
           <operation>
           <description>JBoss Service lifecycle operation</description>
           <name>destroy</name>
           </operation>
          
           <operation>
           <description>Pause the bridge</description>
           <name>pause</name>
           </operation>
          
           <operation>
           <description>Resume the bridge</description>
           <name>resume</name>
           </operation>
          
          </mbean>
          


          • 2. Re: Message bridge
            Tim Fox Master

            So basically the source and the target are specified as JMS provider adaptors, then you just specify source and target destinations, quality of service and various other params.

            • 3. Re: Message bridge
              Karl de Boer Newbie

              Oh wonderfull!
              The basic scenario is this: I want an application to write locally into a non persistent JMS queue (In fact a log4J queue appender). Logging in this way is fast and not depending on network availablitly. However i want to access the log messages on a central server. Therefore i want to store and forward the data to a remote queue in the background.

              So i have to add a remote jms provider to the local jms-ds.xml and use this one as the destination jms provider? And the remote destination is found using the jndi properties of this remote provider (inj the local jms-ds.xml)?

              If i have it working i will create the wiki page

              • 4. Re: Message bridge
                Tim Fox Master

                You can install the bridge mbean on either the remote or the local server (or even on a third completely separate server).

                The bridge then requires a jms provider to be setup for both the source and the target.

                So, if you have installed the bridge on the machine with the log4j queue then the source jms provider would just be the default one in jms-ds.xml (the local jms provider), and then you would setup another jms provider with a different name pointing to the remote jms server. The jndi properties of the remote server are specified in the jms provider config.