}
}
protected void sendToTopicXA(Topic topic, XATopicConnectionFactory xaTopicConnectionFactory) throws Exception {
XATopicConnection xaTopicConnection = null;
XATopicSession xaTopicSession = null;
MessageProducer messageProducer = null;
try {
xaTopicConnection = xaTopicConnectionFactory.createXATopicConnection();
xaTopicSession = xaTopicConnection.createXATopicSession();
messageProducer = xaTopicSession.createProducer(topic);
Message message = createMessage(xaTopicSession);
messageProducer.send(message);
} finally {
try {
messageProducer.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
xaTopicSession.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
xaTopicConnection.close();