qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject [17/25] qpid-proton git commit: https://issues.apache.org/jira/browse/PROTON-845
Date Fri, 24 Apr 2015 15:20:47 GMT
https://issues.apache.org/jira/browse/PROTON-845

Check for no Headers object and create one as needed.
(cherry picked from commit b541ad08805e5567bfe8279650a674163c46cb8d)


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

Branch: refs/heads/0.9.x
Commit: b6fc285c3a7bd1bf0575c78fee40d35168f9acf8
Parents: c3364ef
Author: Timothy Bish <tabish121@gmail.com>
Authored: Mon Apr 6 17:06:59 2015 -0400
Committer: Robert Gemmell <robbie@apache.org>
Committed: Fri Apr 24 15:44:52 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b6fc285c/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 8245fb8..7dc71d7 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
@@ -20,11 +20,13 @@ import org.apache.qpid.proton.codec.CompositeWritableBuffer;
 import org.apache.qpid.proton.codec.DroppingWritableBuffer;
 import org.apache.qpid.proton.codec.WritableBuffer;
 import org.apache.qpid.proton.amqp.UnsignedInteger;
+import org.apache.qpid.proton.amqp.messaging.Header;
 
 import javax.jms.BytesMessage;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageFormatException;
+
 import java.nio.ByteBuffer;
 
 import org.apache.qpid.proton.message.ProtonJMessage;
@@ -83,6 +85,10 @@ public class AMQPNativeOutboundTransformer extends OutboundTransformer
{
                 // Update the DeliveryCount header...
                 // The AMQP delivery-count field only includes prior failed delivery attempts,
                 // whereas JMSXDeliveryCount includes the first/current delivery attempt.
Subtract 1.
+                if (amqp.getHeader() == null) {
+                    amqp.setHeader(new Header());
+                }
+
                 amqp.getHeader().setDeliveryCount(new UnsignedInteger(count - 1));
 
                 // Re-encode...


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


Mime
View raw message