2 Replies Latest reply on Jul 3, 2013 10:09 AM by Justin Bertram

    jms bridge

    akash bansal Newbie

      Hi,

       

      I am trying to create JMS bridge between two servers on different machines to forward messages received on queue on first machine to queue on different machine.

       

      For this I have created connected and bridge as following:

       

      <netty-connector name="logger" socket-binding="messaging">

             <param key="host" value="192.168.61.87"/>

             <param key="port" value="5445"/>

      </netty-connector>

       

      <bridges>

          <bridge name="logger_bridge">

              <queue-name>loggingTopic</queue-name>

              <forwarding-address>fc/loggingQueue</forwarding-address>

              <ha>false</ha>

              <failover-on-server-shutdown>false</failover-on-server-shutdown>

              <use-duplicate-detection>false</use-duplicate-detection>

              <static-connectors>

                  <connector-ref>

                      logger

                  </connector-ref>

              </static-connectors>

          </bridge>

      </bridges>

       

      But I am not able to create bridge. I send message to queue on source machine but it is not being moved to destination queue on different machine by bridge.

       

      I have attached my standalone-full-ha.xml configuration file. Pls. help me.

        • 1. Re: jms bridge
          Miroslav Novak Master

          Hi,

           

          I believe that  configuration of netty connector for bridge is obsolete (and not working). You need to specify outbound socket binding like:

                  <outbound-socket-binding name="target-for-bridge">

                      <remote-destination host="192.168.40.1" port="5445"/>

                  </outbound-socket-binding>

           

          There is one more thing. In your configuration you specify HornetQ core bridge (not JMS bridge). Example of confinguration which is similar to yours and works for me :-) :

           

          <bridges>

                              <bridge name="myBridge">

                                  <queue-name>jms.queue.InQueue</queue-name>

                                  <forwarding-address>jms.queue.OutQueue</forwarding-address>

                                  <ha>true</ha>

                                  <reconnect-attempts>-1</reconnect-attempts>

                                  <use-duplicate-detection>true</use-duplicate-detection>

                                  <static-connectors>

                                      <connector-ref>

                                          bridge-connector

                                      </connector-ref>

                                  </static-connectors>

                              </bridge>

                          </bridges>

           

          Example of configuration for JMS bridge:

           

          <subsystem xmlns="urn:jboss:domain:messaging:1.3">

                       <hornetq-server>

                       ...

                       </hornetq-server>

           

                       <jms-bridge name="myBridge">

                          <source>

                              <connection-factory name="jms/RemoteConnectionFactory"/>

                              <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://192.168.40.1:4447"/>

                              </context>

                          </target>

                          <quality-of-service>AT_MOST_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>

           

          Cheers,

           

          Mirek

          1 of 1 people found this helpful
          • 2. Re: jms bridge
            Justin Bertram Master

            This is certainly incorrect:

             

               <netty-connector name="logger" socket-binding="messaging">

                   <param key="host" value="192.168.61.87"/>

                   <param key="port" value="5445"/>

               </netty-connector>

             

            You should use either this (as Mirek indicated):

             

               <netty-connector name="logger" socket-binding="target-for-bridge"/>

                ...

               <outbound-socket-binding name="target-for-bridge">

                   <remote-destination host="targetHostName" port="5445"/>

               </outbound-socket-binding>

             

            OR:

             

               <connector name="logger">

                   <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                   <param key="host" value="targetHostName"/>

                   <param key="port" value="5445"/>

               </connector>

            1 of 1 people found this helpful