qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject qpid-jms git commit: https://issues.apache.org/jira/browse/QPIDJMS-41
Date Tue, 14 Apr 2015 14:06:42 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master f6520d25d -> e7d083e36


https://issues.apache.org/jira/browse/QPIDJMS-41

Ensures that we settle to deliveries so that proton-j can remove them
from its state information. 

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

Branch: refs/heads/master
Commit: e7d083e36d4d07befe1eaa09ce150c1aa88169c4
Parents: f6520d2
Author: Timothy Bish <tabish121@gmail.com>
Authored: Tue Apr 14 10:05:54 2015 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Tue Apr 14 10:06:17 2015 -0400

----------------------------------------------------------------------
 .../apache/qpid/jms/provider/amqp/AmqpFixedProducer.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/e7d083e3/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
index 07d7fef..8ff6b9c 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
@@ -209,13 +209,12 @@ public class AmqpFixedProducer extends AmqpProducer {
                 outcome = (Outcome) state;
             } else {
                 LOG.warn("Message send updated with unsupported state: {}", state);
-                continue;
+                outcome = null;
             }
 
             AsyncResult request = (AsyncResult) delivery.getContext();
 
             if (outcome instanceof Accepted) {
-                toRemove.add(delivery);
                 LOG.trace("Outcome of delivery was accepted: {}", delivery);
                 tagGenerator.returnTag(delivery.getTag());
                 if (request != null && !request.isComplete()) {
@@ -223,7 +222,6 @@ public class AmqpFixedProducer extends AmqpProducer {
                 }
             } else if (outcome instanceof Rejected) {
                 Exception remoteError = getRemoteError();
-                toRemove.add(delivery);
                 LOG.trace("Outcome of delivery was rejected: {}", delivery);
                 tagGenerator.returnTag(delivery.getTag());
                 if (request != null && !request.isComplete()) {
@@ -231,9 +229,13 @@ public class AmqpFixedProducer extends AmqpProducer {
                 } else {
                     connection.getProvider().fireProviderException(remoteError);
                 }
-            } else {
+            } else if (outcome != null) {
+                // TODO - Revisit these and better handle unknown or other outcomes
                 LOG.warn("Message send updated with unsupported outcome: {}", outcome);
             }
+
+            toRemove.add(delivery);
+            delivery.settle();
         }
 
         pending.removeAll(toRemove);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message