activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r360132 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq: ActiveMQConnectionFactory.java broker/region/PrefetchSubscription.java
Date Fri, 30 Dec 2005 18:25:19 GMT
Author: jstrachan
Date: Fri Dec 30 10:25:15 2005
New Revision: 360132

URL: http://svn.apache.org/viewcvs?rev=360132&view=rev
Log:
avoid possible NPE; only set the redeliveryPolicy if there is one configured

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java?rev=360132&r1=360131&r2=360132&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
Fri Dec 30 10:25:15 2005
@@ -210,7 +210,9 @@
             connection.setAsyncDispatch(isAsyncDispatch());
             connection.setUseAsyncSend(isUseAsyncSend());
             connection.setUseRetroactiveConsumer(isUseRetroactiveConsumer());
-            connection.setRedeliveryPolicy(getRedeliveryPolicy());
+            if (getRedeliveryPolicy() != null) {
+                connection.setRedeliveryPolicy(getRedeliveryPolicy());
+            }
 
             if( clientID !=null )
                 connection.setClientID(clientID);

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java?rev=360132&r1=360131&r2=360132&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
Fri Dec 30 10:25:15 2005
@@ -175,11 +175,14 @@
                         Message message = node.getMessage();
                         if( message !=null ) {
                             
-                            // TODO is this meant to be == null - it was != ?
-                            if( message.getOriginalDestination()==null )
+                            // TODO is this meant to be == null?
+                            if( message.getOriginalDestination()!=null )
                                 message.setOriginalDestination(message.getDestination());
                             
                             ActiveMQDestination originalDestination = message.getOriginalDestination();
+                            if (originalDestination == null) {
+                                originalDestination = message.getDestination();
+                            }
                             DeadLetterStrategy deadLetterStrategy = node.getRegionDestination().getDeadLetterStrategy();
                             ActiveMQDestination deadLetterDestination = deadLetterStrategy.getDeadLetterQueueFor(originalDestination);
                             message.setDestination(deadLetterDestination);



Mime
View raw message