activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1403752 - /activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/transform/InboundTransformer.java
Date Tue, 30 Oct 2012 15:56:13 GMT
Author: chirino
Date: Tue Oct 30 15:56:13 2012
New Revision: 1403752

URL: http://svn.apache.org/viewvc?rev=1403752&view=rev
Log:
Use the transformer default values for delivery mode, priority and ttl if not set on the amqp
header.

Modified:
    activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/transform/InboundTransformer.java

Modified: activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/transform/InboundTransformer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/transform/InboundTransformer.java?rev=1403752&r1=1403751&r2=1403752&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/transform/InboundTransformer.java
(original)
+++ activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/transform/InboundTransformer.java
Tue Oct 30 15:56:13 2012
@@ -99,23 +99,31 @@ public abstract class InboundTransformer
     }
 
     protected void populateMessage(Message jms, org.apache.qpid.proton.message.Message amqp)
throws Exception {
-        final Header header = amqp.getHeader();
-        if( header!=null ) {
-            if( header.getDurable()!=null ) {
-                jms.setJMSDeliveryMode(header.getDurable().booleanValue() ? DeliveryMode.PERSISTENT
: DeliveryMode.NON_PERSISTENT);
-            }
-            if( header.getPriority()!=null ) {
-                jms.setJMSPriority(header.getPriority().intValue());
-            }
-            if( header.getTtl()!=null ) {
-                jms.setJMSExpiration(header.getTtl().longValue());
-            }
-            if( header.getFirstAcquirer() !=null ) {
-                jms.setBooleanProperty(prefixVendor + "FirstAcquirer", header.getFirstAcquirer());
-            }
-            if( header.getDeliveryCount()!=null ) {
-                vendor.setJMSXDeliveryCount(jms, header.getDeliveryCount().longValue());
-            }
+        Header header = amqp.getHeader();
+        if( header==null ) {
+            header = new Header();
+        }
+
+        if( header.getDurable()!=null ) {
+            jms.setJMSDeliveryMode(header.getDurable().booleanValue() ? DeliveryMode.PERSISTENT
: DeliveryMode.NON_PERSISTENT);
+        } else {
+            jms.setJMSDeliveryMode(defaultDeliveryMode);
+        }
+        if( header.getPriority()!=null ) {
+            jms.setJMSPriority(header.getPriority().intValue());
+        } else {
+            jms.setJMSPriority(defaultPriority);
+        }
+        if( header.getTtl()!=null ) {
+            jms.setJMSExpiration(header.getTtl().longValue());
+        } else {
+            jms.setJMSExpiration(defaultTtl);
+        }
+        if( header.getFirstAcquirer() !=null ) {
+            jms.setBooleanProperty(prefixVendor + "FirstAcquirer", header.getFirstAcquirer());
+        }
+        if( header.getDeliveryCount()!=null ) {
+            vendor.setJMSXDeliveryCount(jms, header.getDeliveryCount().longValue());
         }
 
         final DeliveryAnnotations da = amqp.getDeliveryAnnotations();



Mime
View raw message