You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2015/04/06 23:07:18 UTC

qpid-proton git commit: https://issues.apache.org/jira/browse/PROTON-845

Repository: qpid-proton
Updated Branches:
  refs/heads/master 677ea33fd -> b541ad088


https://issues.apache.org/jira/browse/PROTON-845

Check for no Headers object and create one as needed.  

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

Branch: refs/heads/master
Commit: b541ad08805e5567bfe8279650a674163c46cb8d
Parents: 677ea33
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Apr 6 17:06:59 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon Apr 6 17:06:59 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b541ad08/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