try
{
InetAddress address = InetAddress.getLocalHost();
AMQConnection con1 = new AMQConnection(args[0], Integer.parseInt(args[1]), args[2], args[3],
address.getHostName(), args[4]);
final Session session1 = con1.createSession(false, Session.AUTO_ACKNOWLEDGE);
AMQConnection con2 = new AMQConnection(args[0], Integer.parseInt(args[1]), args[2], args[3],
address.getHostName(), args[4]);
final Session session2 = con2.createSession(false, Session.AUTO_ACKNOWLEDGE);
String selector = args[6];
final int expectedMessageCount = Integer.parseInt(args[5]);
_logger.info("Message selector is <" + selector + ">...");
Topic t = new AMQTopic(session1.getDefaultTopicExchangeName(), new AMQShortString("cbr"));
MessageConsumer consumer1 = session1.createConsumer(t,
100, false, false, selector);
MessageConsumer consumer2 = session2.createConsumer(t,
100, false, false, selector);
consumer1.setMessageListener(new TestMessageListener("ML 1", expectedMessageCount));
consumer2.setMessageListener(new TestMessageListener("ML 2", expectedMessageCount));
con1.start();