HornetQ can be configured to accept requests from any AMQP client that supports the 1.0 version of the protocol. This example shows a simply qpid java 1.0 client example
To run the example simply run the command
To configure HornetQ to accept AMQP client connections you need to add an Acceptor like so:
<acceptor name="proton-acceptor">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocol" value="AMQP"/>
<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();