3 Replies Latest reply on Dec 8, 2009 2:41 PM by Ian Yu

    best way to run example on two different physical machines

    Ian Yu Newbie

      A week ago, I started to play with JMS on HornetQ, after a
      recommendations by my colleague.

      It was enjoyable to run some of the examples that come
      with "HornetQ-2.0.0.BETA5".

      When we run the "/examples/javaee/mdb-tx-send" example,
      including the client and the server deployed in JBoss AS,
      all on the same computer, we have great results.

      Now to make it a possible atlernative to part of our current
      software solutions, we want to run the above example on two
      different physical machines: client on one machine, and
      server receiver running HornetQ inside JBoss AS on the other.

      We did not find a ready to go example for this out of the box,
      so we made a copy of the example to put on two machines: A & B.

      What is the best way to make it so that, client on machine A
      sends a message to a service living inside HornetQ, deployed in
      JBoss AS on machine B?

      Thank you.

        • 1. Re: best way to run example on two different physical machin
          Ross Nicholson Apprentice

          You could try using a core bridge.

          Have a look at the connectors and acceptors section the the manual followed by the bridges section.

          You basically need a connector on machine A that points to machine B and an acceptor on machine B that can receive from machine B. Then a bridge on machine A that connects to the queue on machine B. Make sure you have true in your hornetq-configuration.xml otherwise the bridge will be disabled by default (this caught me out the first time I tried to do this!).

          Post back if you need any more help.

          R.

          • 2. Re: best way to run example on two different physical machin
            Ross Nicholson Apprentice

            Apologies. that middle paragraph should have read:

            You basically need a connector on machine A that points to machine B and an acceptor on machine B that can receive from machine A. Then a bridge on machine A that connects to the queue on machine B. Make sure you have

            <clustered>true</clustered>

            in your hornetq-configuration.xml otherwise the bridge will be disabled by default (this caught me out the first time I tried to do this!).

            • 3. Re: best way to run example on two different physical machin
              Ian Yu Newbie

              Thank you for your suggestion on using a core bridge, to accomplish this.
              Once implemented as you have recommended here, does it mean that there will be a server instance running on machine A, and then another server instance running on machine B?

              We appreciated your taking the time to help us with this.