PROTON-715: subtract 1 when setting delivery-count header based on 
JMSXDeliveryCount during outbound Native transformation

git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1632091 
13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/examples
Commit: 07554b96cc81828e7903371ebd7f99bfd2747514
Parents: e843420
Author: Robert Gemmell <[email protected]>
Authored: Wed Oct 15 15:31:18 2014 +0000
Committer: Robert Gemmell <[email protected]>
Committed: Wed Oct 15 15:31:18 2014 +0000

----------------------------------------------------------------------
 .../apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/07554b96/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
----------------------------------------------------------------------
diff --git 
a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
 
b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
index 66ff0b1..8245fb8 100644
--- 
a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
+++ 
b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
@@ -81,7 +81,9 @@ public class AMQPNativeOutboundTransformer extends 
OutboundTransformer {
                 }
 
                 // Update the DeliveryCount header...
-                amqp.getHeader().setDeliveryCount(new UnsignedInteger(count));
+                // The AMQP delivery-count field only includes prior failed 
delivery attempts,
+                // whereas JMSXDeliveryCount includes the first/current 
delivery attempt. Subtract 1.
+                amqp.getHeader().setDeliveryCount(new UnsignedInteger(count - 
1));
 
                 // Re-encode...
                 ByteBuffer buffer = ByteBuffer.wrap(new byte[1024*4]);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to