ConnectionFactory fac = new ActiveMQConnectionFactory("vm://localhost");
producerConnection = fac.createConnection();
Session s = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination dest = s.createTopic(getClass().getName());
MessageProducer producer = s.createProducer(dest);
consumerConnection = fac.createConnection();
s = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = s.createConsumer(dest);
consumerConnection.start();
out = new DataOutputStream(new JMSOutputStream(producer));
in = new DataInputStream(new JMSInputStream(consumer));