740741742743744745746747748749750
cons1.close(); MessageConsumer cons2 = sess.createConsumer(queue); sess.commit(); TextMessage rm2 = (TextMessage)cons2.receive(1500); assertNotNull(rm2); assertEquals("b", rm2.getText());
783784785786787788789790791792793
TextMessage tm2 = sess.createTextMessage("hello2"); TextMessage tm3 = sess.createTextMessage("hello3"); prod.send(tm1); prod.send(tm2); prod.send(tm3); sess.commit(); MessageConsumer cons1 = sess.createConsumer(queue); TextMessage rm1 = (TextMessage)cons1.receive(1500); assertNotNull(rm1);
795796797798799800801802803804805
cons1.close(); MessageConsumer cons2 = sess.createConsumer(queue); sess.commit(); TextMessage rm2 = (TextMessage)cons2.receive(1500); assertNotNull(rm2); assertEquals("hello2", rm2.getText());
837838839840841842843844845846847
847848849850851852853854855856857
assertNotNull(rm1); assertEquals("hello1", rm1.getText()); cons1.close(); sess.commit(); MessageConsumer cons2 = sess.createConsumer(queue); TextMessage rm2 = (TextMessage)cons2.receive(1500); assertNotNull(rm2);
892893894895896897898899900901902
948949950951952953954955956957958
13651366136713681369137013711372137313741375
Message m = sessSend.createTextMessage("hello"); prod.send(queue2, m); sessSend.commit(); connReceive = cf.createConnection(); connReceive.start();
13811382138313841385138613871388138913901391
assertNotNull(m2); assertEquals("hello", m2.getText()); sessReceive.commit(); cons.close(); connReceive = cf.createConnection();
334335336337338339340341342343344
// if I don't receive enough messages, the test will timeout log.trace("Received " + i + " messages after recover"); consumerSess.commit(); assertRemainingMessages(0); // make sure I don't receive anything else