private void commit(LocalTransactionId tx, ConnectionContext connectionContext, Message message) throws Exception { if (tx != null) { connectionContext.getBroker().commitTransaction(connectionContext, tx, true); connectionContext.getTransactions().remove(tx); connectionContext.setTransaction(null); message.setTransactionId(null); } }
public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = consumerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (ack.isInTransaction()) { transaction = getTransaction(context, ack.getTransactionId(), false); } context.setTransaction(transaction); try { next.acknowledge(consumerExchange, ack); } finally { context.setTransaction(originalTx); } }
public void send(ProducerBrokerExchange producerExchange, final Message message) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = producerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (message.getTransactionId() != null) { transaction = getTransaction(context, message.getTransactionId(), false); } context.setTransaction(transaction); try { next.send(producerExchange, message); } finally { context.setTransaction(originalTx); } }
private LocalTransactionId beginLocalTransaction(int numDestinations, ConnectionContext connectionContext, Message message) throws Exception { LocalTransactionId result = null; if (transactedSend && numDestinations > 1 && message.isPersistent() && message.getTransactionId() == null) { result = new LocalTransactionId(new ConnectionId(message.getMessageId().getProducerId().toString()), message.getMessageId().getProducerSequenceId()); connectionContext.getBroker().beginTransaction(connectionContext, result); connectionContext.setTransaction(connectionContext.getTransactions().get(result)); message.setTransactionId(result); } return result; }
private void commit(LocalTransactionId tx, ConnectionContext connectionContext, Message message) throws Exception { if (tx != null) { connectionContext.getBroker().commitTransaction(connectionContext, tx, true); connectionContext.getTransactions().remove(tx); connectionContext.setTransaction(null); message.setTransactionId(null); } }
private void commit(LocalTransactionId tx, ConnectionContext connectionContext, Message message) throws Exception { if (tx != null) { connectionContext.getBroker().commitTransaction(connectionContext, tx, true); connectionContext.getTransactions().remove(tx); connectionContext.setTransaction(null); message.setTransactionId(null); } }
private void commit(LocalTransactionId tx, ConnectionContext connectionContext, Message message) throws Exception { if (tx != null) { connectionContext.getBroker().commitTransaction(connectionContext, tx, true); connectionContext.getTransactions().remove(tx); connectionContext.setTransaction(null); message.setTransactionId(null); } }
public void send(ProducerBrokerExchange producerExchange, final Message message) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = producerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (message.getTransactionId() != null) { transaction = getTransaction(context, message.getTransactionId(), false); } context.setTransaction(transaction); try { next.send(producerExchange, message); } finally { context.setTransaction(originalTx); } }
public void send(ProducerBrokerExchange producerExchange, final Message message) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = producerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (message.getTransactionId() != null) { transaction = getTransaction(context, message.getTransactionId(), false); } context.setTransaction(transaction); try { next.send(producerExchange, message); } finally { context.setTransaction(originalTx); } }
public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = consumerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (ack.isInTransaction()) { transaction = getTransaction(context, ack.getTransactionId(), false); } context.setTransaction(transaction); try { next.acknowledge(consumerExchange, ack); } finally { context.setTransaction(originalTx); } }
public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = consumerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (ack.isInTransaction()) { transaction = getTransaction(context, ack.getTransactionId(), false); } context.setTransaction(transaction); try { next.acknowledge(consumerExchange, ack); } finally { context.setTransaction(originalTx); } }
public void send(ProducerBrokerExchange producerExchange, final Message message) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = producerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (message.getTransactionId() != null) { transaction = getTransaction(context, message.getTransactionId(), false); } context.setTransaction(transaction); try { next.send(producerExchange, message); } finally { context.setTransaction(originalTx); } }
public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = consumerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (ack.isInTransaction()) { transaction = getTransaction(context, ack.getTransactionId(), false); } context.setTransaction(transaction); try { next.acknowledge(consumerExchange, ack); } finally { context.setTransaction(originalTx); } }
public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { // This method may be invoked recursively. // Track original tx so that it can be restored. final ConnectionContext context = consumerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; if (ack.isInTransaction()) { transaction = getTransaction(context, ack.getTransactionId(), false); } context.setTransaction(transaction); try { next.acknowledge(consumerExchange, ack); } finally { context.setTransaction(originalTx); } }
context.setTransaction(transaction); try { next.send(producerExchange, message); } finally { context.setTransaction(originalTx);
private LocalTransactionId beginLocalTransaction(int numDestinations, ConnectionContext connectionContext, Message message) throws Exception { LocalTransactionId result = null; if (transactedSend && numDestinations > 1 && message.isPersistent() && message.getTransactionId() == null) { result = new LocalTransactionId(new ConnectionId(message.getMessageId().getProducerId().toString()), message.getMessageId().getProducerSequenceId()); connectionContext.getBroker().beginTransaction(connectionContext, result); connectionContext.setTransaction(connectionContext.getTransactions().get(result)); message.setTransactionId(result); } return result; }
private LocalTransactionId beginLocalTransaction(int numDestinations, ConnectionContext connectionContext, Message message) throws Exception { LocalTransactionId result = null; if (transactedSend && numDestinations > 1 && message.isPersistent() && message.getTransactionId() == null) { result = new LocalTransactionId(new ConnectionId(message.getMessageId().getProducerId().toString()), message.getMessageId().getProducerSequenceId()); connectionContext.getBroker().beginTransaction(connectionContext, result); connectionContext.setTransaction(connectionContext.getTransactions().get(result)); message.setTransactionId(result); } return result; }
private LocalTransactionId beginLocalTransaction(int numDestinations, ConnectionContext connectionContext, Message message) throws Exception { LocalTransactionId result = null; if (transactedSend && numDestinations > 1 && message.isPersistent() && message.getTransactionId() == null) { result = new LocalTransactionId(new ConnectionId(message.getMessageId().getProducerId().toString()), message.getMessageId().getProducerSequenceId()); connectionContext.getBroker().beginTransaction(connectionContext, result); connectionContext.setTransaction(connectionContext.getTransactions().get(result)); message.setTransactionId(result); } return result; }