activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: ARTEMIS-332 - fix openwire after exceptions change
Date Thu, 07 Jan 2016 01:00:05 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master a5a993ed9 -> 0dab0552d


ARTEMIS-332 - fix openwire after exceptions change


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

Branch: refs/heads/master
Commit: 0dab0552dcf9b8f54f87f9dc9d7317fece8fca5d
Parents: a5a993e
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed Jan 6 19:58:15 2016 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Jan 6 19:58:15 2016 -0500

----------------------------------------------------------------------
 .../openwire/amq/AMQServerConsumer.java         | 36 ++++++++------------
 1 file changed, 15 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0dab0552/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerConsumer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerConsumer.java
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerConsumer.java
index 625adcd..865146e 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerConsumer.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerConsumer.java
@@ -126,30 +126,24 @@ public class AMQServerConsumer extends ServerConsumerImpl {
    }
 
    public void amqPutBackToDeliveringList(final List<MessageReference> refs) {
-      try {
-         synchronized (this.deliveringRefs) {
-            for (MessageReference ref : refs) {
-               ref.incrementDeliveryCount();
-               deliveringRefs.add(ref);
-            }
-            //adjust the order. Suppose deliveringRefs has 2 existing
-            //refs m1, m2, and refs has 3 m3, m4, m5
-            //new order must be m3, m4, m5, m1, m2
-            if (refs.size() > 0) {
-               long first = refs.get(0).getMessage().getMessageID();
-               MessageReference m = deliveringRefs.peek();
-               while (m.getMessage().getMessageID() != first) {
-                  deliveringRefs.poll();
-                  deliveringRefs.add(m);
-                  m = deliveringRefs.peek();
-               }
+      synchronized (this.deliveringRefs) {
+         for (MessageReference ref : refs) {
+            ref.incrementDeliveryCount();
+            deliveringRefs.add(ref);
+         }
+         //adjust the order. Suppose deliveringRefs has 2 existing
+         //refs m1, m2, and refs has 3 m3, m4, m5
+         //new order must be m3, m4, m5, m1, m2
+         if (refs.size() > 0) {
+            long first = refs.get(0).getMessage().getMessageID();
+            MessageReference m = deliveringRefs.peek();
+            while (m.getMessage().getMessageID() != first) {
+               deliveringRefs.poll();
+               deliveringRefs.add(m);
+               m = deliveringRefs.peek();
             }
          }
       }
-      catch (ActiveMQException e) {
-         // TODO: what to do here?
-         throw new IllegalStateException(e.getMessage(), e);
-      }
    }
 
    public void moveToDeadLetterAddress(long mid, Throwable cause) throws Exception {


Mime
View raw message