Connecting to the Embedded HornetQ using Core
43.3.1. Core API If using the core API, just create the ClientSessionFactory and use the regular core API. ClientSessionFactory nettyFactory = HornetQClient.createClientSessionFactory( new TransportConfiguration( InVMConnectorFactory.class.getName())); ClientSession session = factory.createSession(); session.createQueue("example", "example", true); ClientProducer producer = session.createProducer("example"); ClientMessage message = session.createMessage(true); message.getBody().writeString("Hello"); producer.send(message); session.start(); ClientConsumer consumer = session.createConsumer("example"); ClientMessage msgReceived = consumer.receive(); System.out.println("message = " + msgReceived.getBody().readString()); session.close();