You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2015/04/14 14:55:20 UTC

activemq git commit: https://issues.apache.org/jira/browse/AMQ-4929 - remove audit from TransactionBroker

Repository: activemq
Updated Branches:
  refs/heads/master 2852a8bdb -> f556076a2


https://issues.apache.org/jira/browse/AMQ-4929 - remove audit from TransactionBroker


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f556076a
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f556076a
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f556076a

Branch: refs/heads/master
Commit: f556076a2c6e174bbb2e3f3214511a971cfc99d9
Parents: 2852a8b
Author: Dejan Bosanac <de...@nighttale.net>
Authored: Tue Apr 14 14:55:11 2015 +0200
Committer: Dejan Bosanac <de...@nighttale.net>
Committed: Tue Apr 14 14:55:11 2015 +0200

----------------------------------------------------------------------
 .../activemq/broker/TransactionBroker.java      | 37 +++-----------------
 1 file changed, 5 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/f556076a/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java
----------------------------------------------------------------------
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 016baa4..caea29f 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<TransactionId, XATransaction> xaTransactions = new LinkedHashMap<TransactionId, XATransaction>();
-    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();
-        }
-    }
-
 }