{
drainQueue();
drainDurableTopic();
final int iterationCount = getIterationCount();
final Logger log = getLog();
Thread sendThread =
new Thread()
{
public void run()
{
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);
for (int i = 0; i < iterationCount; i++)
{
publisher.publish(message, persistence, 4, 0);
}
session.close();
}
catch (Exception e)
{
log.error("error", e);
}
}
};
TopicSession session = topicDurableConnection.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);