MessageConsumer cons1 = sess.createConsumer(queue,"target='1'");
MessageConsumer cons2 = sess.createConsumer(queue,"target='2'");
produceMessages(sess, prod, 30, cons1,cons2,payLoad);
JVMTIInterface jvmti = new JVMTIInterface();
Map inventory1=jvmti.produceInventory();
log.info("Producing first snapshot");
produceMessages(sess, prod, 10, cons1,cons2,payLoad);
produceMessages(sess, prod, 10, cons1,cons2,payLoad);
produceMessages(sess, prod, 10, cons1,cons2,payLoad);
produceMessages(sess, prod, 10, cons1,cons2,payLoad);
produceMessages(sess, prod, 10, cons1,cons2,payLoad);
produceMessages(sess, prod, 10, cons1,cons2,payLoad);
log.info("Producing second snapshot");
Map inventory2 = jvmti.produceInventory();
log.info("inventory1.size=" + inventory1.size());
log.info("inventory2.size=" + inventory2.size());
assertTrue("Test produced unexpected objects",jvmti.compareInventories(System.out, inventory1,inventory2,null, null, new InventoryDataPoint[] {new InventoryDataPoint(Object.class,10)}));
conn.close();
conn = null;