6364656667686970717273
for (i = 0; i < 10; i++) { msg.setText("Test number " + i); qsend.send(msg); } qs.commit(); System.out.println(i + " messages sent."); qc.close(); } }
408409410411412413414415416417418
sender.send( message, persistence, 4, 0); //sender.send(queue, message, persistence, 4, 0); //getLog().debug(" Sent #"+i); if (transacted == TRANS_INDIVIDUAL) { session.commit(); } } if (transacted == TRANS_TOTAL) {
414415416417418419420421422423424
} } if (transacted == TRANS_TOTAL) { session.commit(); } session.close(); long endTime = System.currentTimeMillis();
453454455456457458459460461462463
{ receiver.receive(); //getLog().debug(" Received #"+i); if (transacted == TRANS_INDIVIDUAL) { session.commit(); } } if (transacted == TRANS_TOTAL) {
459460461462463464465466467468469
} } if (transacted == TRANS_TOTAL) { session.commit(); } long endTime = System.currentTimeMillis(); session.close();
130131132133134135136137138139140
//sender.send(queue, message, persistence, 4, 0); sender.send(message, persistence, 4, 0); //getLog().debug(" Sent #"+i); if (transacted == TRANS_INDIVIDUAL) { session.commit(); } } if (transacted == TRANS_TOTAL) {
136137138139140141142143144145146
173174175176177178179180181182183
public void onMessage(Message message) { try { if( transacted == TRANS_INDIVIDUAL ) session.commit(); i++; } catch (JMSException e) { getLog().error("Unable to commit", e);
213214215216217218219220221222223
listener.wait(); } if (transacted == TRANS_TOTAL) { session.commit(); } session.close(); sendThread.join(); long endTime = System.currentTimeMillis();
107108109110111112113114115116117
Message m1 = sess.createTextMessage("testing1"); Message m2 = sess.createTextMessage("testing2"); producer.send(m1); producer.send(m2); sess.commit(); TextMessage mr = (TextMessage)cons.receive(3000); assertNotNull(mr); assertEquals("testing1", mr.getText());