Connecting to the Embedded HornetQ using JMS

WARNING - TOPIC NOT WRITTEN - TOPIC ID: 858

This topic has not yet been written. The content below is from the topic description.
43.3.2. JMS API Connection on an Embedded HornetQ through JMS is also simple. Just instantiate ConnectionFactory directly. The following example illustrates that. ConnectionFactory cf = HornetQJMSClient.createConnectionFactory( new TransportConfiguration(InVMConnectorFactory.class.getName())); Connection conn = cf.createConnection(); conn.start(); Session sess = conn.createSession(true, Session.SESSION_TRANSACTED); MessageProducer prod = sess.createProducer(queue); TextMessage msg = sess.createTextMessage("Hello!"); prod.send(msg); sess.commit(); MessageConsumer consumer = sess.createConsumer(queue); TextMessage txtmsg = (TextMessage)consumer.receive(); System.out.println("Msg = " + txtmsg.getText()); sess.commit(); conn.close();