235236237238239240241242243244245
} } messagesRead += (messageCount - lastCount); session.commit(); consumer.close(); session.close(); } catch (Exception e) {
287288289290291292293294295296297
{ log.debug("commit"); messagesProduced += (messageCount - lastMessage); lastMessage = messageCount; sess.commit(); } else { log.debug("rollback"); lastMessage = messageCount;
300301302303304305306307308309310
messageCount ++; } messagesProduced += ((messageCount) - lastMessage); sess.commit(); sess.close(); if (messageCount % 50 == 0) { log.info("Producer " + index + " sent " + messageCount + " messages");
121122123124125126127128129130131
for (int i = 0; i < 100; i++) { assertEquals(1, rm.size()); session.commit(); assertEquals(1, rm.size()); } assertEquals(1, rm.size());
168169170171172173174175176177178
260261262263264265266267268269270
mRec1 = (TextMessage)consumer1.receive(2000); assertEquals("igloo", mRec1.getText()); assertTrue(mRec1.getJMSRedelivered()); sess1.commit(); } finally { if (conn != null) {
292293294295296297298299300301302
Message mSent = sess.createTextMessage("igloo"); producer.send(mSent); sess.commit(); TextMessage mRec = (TextMessage)consumer.receive(2000); assertEquals("igloo", mRec.getText()); assertFalse(mRec.getJMSRedelivered());
307308309310311312313314315316317
assertNotNull(mRec); assertEquals("igloo", mRec.getText()); assertTrue(mRec.getJMSRedelivered()); sess.commit(); } finally { if (conn != null) {
337338339340341342343344345346347
TextMessage mSent = sess.createTextMessage("igloo"); producer.send(mSent); sess.commit(); TextMessage mRec = (TextMessage)consumer.receive(2000); assertEquals("igloo", mRec.getText()); sess.commit();
342343344345346347348349350351352
sess.commit(); TextMessage mRec = (TextMessage)consumer.receive(2000); assertEquals("igloo", mRec.getText()); sess.commit(); mSent.setText("rollback"); producer.send(mSent); sess.commit();