HornetQ is a multi protocol broker. It will inspect the initial handshake of clients to determine what protocol to use.
All you need to do is to connect a client into hornetq's configured port and you should be able connect.
To run this example simply run the command
You don't need to do anything special to configure the HornetQ server to accept AMQP clients.
Just for the sake of documentation though we are setting the port of HornetQ on this example as 5672 which is the port qpid have by default.
This is totally optional and you don't need to follow this convention. You can use any port you chose including HornetQ's 5445 default port
<acceptor name="proton-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="port" value="5672"/>
</acceptor>
connection= new Connection("localhost", 5672, null, null);
Session session = connection.createSession();
Sender sender = session.createSender("testQueue");
sender.send(new Message("I am an amqp message"));
Receiver rec = session.createMovingReceiver("testQueue");
rec.setCredit(UnsignedInteger.valueOf(1), false);
Message m = rec.receive(5000);
System.out.println("message = " + m.getPayload());
rec.acknowledge(m);
connection.close();