session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
consumer = (ActiveMQMessageConsumer) session.createConsumer(TopicExpressionConverter.toActiveMQTopic(topicExpression), toJMSSelector(selector));
consumer.setMessageListener(new MessageListener(){
public void onMessage(Message msg) {
try {
TopicExpressionType topic = TopicExpressionConverter.toTopicExpression((ActiveMQTopic) msg.getJMSDestination());
if( msg instanceof BytesMessage ) {
BytesMessage bm = (BytesMessage) msg;
byte data[] = new byte[(int)bm.getBodyLength()];
bm.readBytes(data);
XmlObject xml = XmlObject.Factory.parse(new ByteArrayInputStream(data));