use of javax.jms.XAConnection in project hazelcast by hazelcast.
the class WriteJmsP method init.
@Override
public void init(@Nonnull Outbox outbox, @Nonnull Context context) throws Exception {
super.init(outbox, context);
if (snapshotUtility.usesTransactionLifecycle()) {
XASession xaSession = ((XAConnection) connection).createXASession();
setXaResource(xaSession.getXAResource());
session = xaSession;
} else {
session = connection.createSession(true, 0);
}
Destination destination = isTopic ? session.createTopic(destinationName) : session.createQueue(destinationName);
producer = session.createProducer(destination);
}
Aggregations