diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java b/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java index 016baa432c..caea29fb27 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java @@ -64,7 +64,6 @@ public class TransactionBroker extends BrokerFilter { // The prepared XA transactions. private TransactionStore transactionStore; private Map xaTransactions = new LinkedHashMap(); - private ActiveMQMessageAudit audit; public TransactionBroker(Broker next, TransactionStore transactionStore) { super(next); @@ -286,33 +285,14 @@ public class TransactionBroker extends BrokerFilter { final ConnectionContext context = producerExchange.getConnectionContext(); Transaction originalTx = context.getTransaction(); Transaction transaction = null; - Synchronization sync = null; if (message.getTransactionId() != null) { transaction = getTransaction(context, message.getTransactionId(), false); - if (transaction != null) { - sync = new Synchronization() { - - public void afterRollback() { - if (audit != null) { - audit.rollback(message); - } - } - }; - transaction.addSynchronization(sync); - } } - if (audit == null || !audit.isDuplicate(message)) { - context.setTransaction(transaction); - try { - next.send(producerExchange, message); - } finally { - context.setTransaction(originalTx); - } - } else { - if (sync != null && transaction != null) { - transaction.removeSynchronization(sync); - } - LOG.debug("IGNORING duplicate message {}", message); + context.setTransaction(transaction); + try { + next.send(producerExchange, message); + } finally { + context.setTransaction(originalTx); } } @@ -378,11 +358,4 @@ public class TransactionBroker extends BrokerFilter { } } - public synchronized void brokerServiceStarted() { - super.brokerServiceStarted(); - if (audit == null) { - audit = new ActiveMQMessageAudit(); - } - } - }