{
try
{
TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = (Topic) context.lookup(TEST_DURABLE_TOPIC);
TopicPublisher publisher = session.createPublisher(topic);
waitForSynchMessage();
BytesMessage message = session.createBytesMessage();
message.writeBytes(PAYLOAD);
message.setStringProperty("TEST_NAME", "runAsynchDurableTopicReceiveRollback");
message.setIntProperty("TEST_PERSISTENCE", persistence);
message.setBooleanProperty("TEST_EXPLICIT", explicit);
for (int i = 0; i < iterationCount; i++)
{
publisher.publish(message, persistence, 4, 0);
log.debug("Published message " + i);
}
session.close();
}
catch (Exception e)
{
log.error("error", e);
}
}
};
TopicSession session = topicDurableConnection.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
Topic topic = (Topic) context.lookup(TEST_DURABLE_TOPIC);
TopicSubscriber subscriber = session.createDurableSubscriber(topic, "test");
try
{
MyMessageListener listener = new MyMessageListener(iterationCount, log);