0 Replies Latest reply on Jan 22, 2012 4:53 PM by mlair

    Remote connection works, messaging bridge not sending on

    mlair

      Hello,

       

      I'm trying to set up a bridge between 2 HornetQ servers.  I am using JBoss AS 7.0.2.Final.  I have a queue called JobQueue on Server A, the sending side, as well as on Server B, the receiving side. Right now they're just running locally on different ports. I want any message sent to Server A's JobQueue automatically sent to Server B's JobQueue.  When I use the ConnectionFactory for the remote connection, it works fine and the message is recieved on the other server.  This makes me think the remote connection set-up isn't the issue.  I've looked throught the HornetQ docs, but wasn't sure if the references for having to have core queues declared as well as jms queues applies for JBoss 7, as that seemed to be an issue related to when the configs were read in.  I've tried with and without the core queues.

       

      The relevant sections of the messaging sub-system of Server A, sending side, are:

       

      <acceptors>
              <netty-acceptor name="netty" socket-binding="messaging"/>
              <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
                      <param key="batch-delay" value="50"/>
                      <param key="direct-deliver" value="false"/>
               </netty-acceptor>
               <in-vm-acceptor name="in-vm" server-id="0"/>
      </acceptors>
      ...
      <connectors>
              <netty-connector name="netty" socket-binding="messaging"/>
              <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                      <param key="batch-delay" value="50"/>
               </netty-connector>
               <in-vm-connector name="in-vm" server-id="0"/>
               <connector name="remote-connector">
                       <factory-class>
                              org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
                       </factory-class>
                       <param key="host" value="localhost"/>
                       <param key="port" value="5645"/>
                </connector>
      </connectors>
      ...
      <bridges>
              <bridge name="bridge-to-job-queue">
                      <queue-name>
                              jms.queue.JobQueue
                      </queue-name>
                      <forwarding-address>
                              jms.queue.JobQueue
                      </forwarding-address>
                      <static-connectors>
                              <connector-ref>
                                      remote-connector
                              </connector-ref>
                      </static-connectors>
              </bridge>
      </bridges>
      ...
      <core-queues>
              <queue name="jms.queue.JobQueue">
                      <address>
                              jms.queue.JobQueue
                      </address>
               </queue>
      </core-queues>
      ....
      <jms-connection-factories>
              <connection-factory name="RemoteVMConnectionFactory">
                      <connectors>
                              <connector-ref connector-name="netty"/>
                      </connectors>
                      <entries>
                              <entry name="java:/RemoteVMConnectionFactory"/>
                      </entries>
              </connection-factory>
              <connection-factory name="InVmConnectionFactory">
                      <connectors>
                              <connector-ref connector-name="in-vm"/>
                      </connectors>
                       <entries>
                              <entry name="java:/InVMConnectionFactory"/>
                       </entries>
               </connection-factory>
               <connection-factory name="RemoteConnectionFactory">
                       <connectors>
                              <connector-ref connector-name="remote-connector"/>
                       </connectors>
                       <entries>
                              <entry name="java:/RemoteConnectionFactory"/>
                       </entries>
               </connection-factory>
               <pooled-connection-factory name="hornetq-ra">
                       <connectors>
                              <connector-ref connector-name="in-vm"/>
                       </connectors>
                       <entries>
                              <entry name="java:/JmsXA"/>
                       </entries>
                       <transaction mode="xa"/>
               </pooled-connection-factory>
      </jms-connection-factories>
      <jms-destinations>
               <jms-queue name="JobQueue">
                       <entry name="/queue/JobQueue"/>
               </jms-queue>
      </jms-destinations>
      
      

       

      The relevant sections of Server B, the receiving side are:

       

      <acceptors>
              <acceptor name="netty-acceptor">
                      <factory-class>
                                  org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory
                      </factory-class>
                      <param key="host" value="localhost"/>
                      <param key="port" value="5645"/>
              </acceptor>
              <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
                       <param key="batch-delay" value="50"/>
                       <param key="direct-deliver" value="false"/>
               </netty-acceptor>
               <in-vm-acceptor name="in-vm" server-id="0"/>
      </acceptors>
      ...
      <connectors>
              <connector name="netty-connector">
                      <factory-class>
                                  org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
                      </factory-class>
                      <param key="host" value="localhost"/>
                      <param key="port" value="5645"/>
              </connector>
              <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                       <param key="batch-delay" value="50"/>
              </netty-connector>
              <in-vm-connector name="in-vm" server-id="0"/>
      </connectors>
      ...
      <jms-destinations>
               <jms-queue name="JobQueue">
                        <entry name="/queue/JobQueue"/>
               </jms-queue>
      </jms-destinations>

       

      When I send a message from Server A to the JobQueue using the RemoteConnectionFactory, the message is recieved on Server B.  When I send a message to the JobQueue on Server A using the InVmConnectionFactory (or any others besides the RemoteConnectionFactory), the message isn't sent on to Server B.  If I deploy an MDB to Server A, the message is sent to Server A's JobQueue and consumed so it's just not getting sent over to Server B.  I'd like to keep the queue names the same on both servers if possible.

       

      Any tips or advice would be greatly appreciated.  Thanks!

       

      (Please note that I have also posted this question to the JBoss AS 7 forum here, as I wasn't sure if this was an issue with the slightly different configuration required by JBoss AS 7.)