javax.naming.Context ctx = new InitialContext(props);
TopicConnectionFactory factory = (TopicConnectionFactory) ctx.lookup("ConnectionFactory");
TopicConnection conn = factory.createTopicConnection();
final Topic topic = (Topic) ctx.lookup("topicName");
TopicSession session = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
TopicSubscriber receiver = session.createSubscriber(topic, selectors, false);
receiver.setMessageListener(new MessageListener() {
public void onMessage(Message message) {
try {
if (message instanceof TextMessage) {