Session.AUTO_ACKNOWLEDGE);
Destination destination = session.createTopic(TOPIC_NAME);
MessageConsumer consumer = session.createConsumer(destination);
// wait till you get atleast one message
MapMessage m;
for (m = null; m == null;) {
m = (MapMessage) consumer.receive();
}
System.out.println("Consumed: " + m.toString());
assertMessage(m);
Assert.assertEquals(m.getString(ARG.feedInstancePaths.getArgName()),
"/falcon/feed/agg-logs/path1/2010/10/10/20");
for (m = null; m == null;) {
m = (MapMessage) consumer.receive();
}
System.out.println("Consumed: " + m.toString());
assertMessage(m);
Assert.assertEquals(m.getString(ARG.feedInstancePaths.getArgName()),
"/falcon/feed/agg-logs/path1/2010/10/10/21");
for (m = null; m == null;) {
m = (MapMessage) consumer.receive();
}
System.out.println("Consumed: " + m.toString());
assertMessage(m);
Assert.assertEquals(m.getString(ARG.feedInstancePaths.getArgName()),
"/falcon/feed/agg-logs/path1/2010/10/10/22");
for (m = null; m == null;) {
m = (MapMessage) consumer.receive();
}
System.out.println("Consumed: " + m.toString());
assertMessage(m);
Assert.assertEquals(m.getString(ARG.feedInstancePaths.getArgName()),
"/falcon/feed/agg-logs/path1/2010/10/10/23");
connection.close();
}