diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java index da2be112d0..867b9e7f28 100755 --- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java +++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java @@ -210,7 +210,9 @@ public class ActiveMQConnectionFactory implements ConnectionFactory, QueueConnec connection.setAsyncDispatch(isAsyncDispatch()); connection.setUseAsyncSend(isUseAsyncSend()); connection.setUseRetroactiveConsumer(isUseRetroactiveConsumer()); - connection.setRedeliveryPolicy(getRedeliveryPolicy()); + if (getRedeliveryPolicy() != null) { + connection.setRedeliveryPolicy(getRedeliveryPolicy()); + } if( clientID !=null ) connection.setClientID(clientID); diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java index 4c1ad1fdd0..93d9e9ae78 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java @@ -175,11 +175,14 @@ abstract public class PrefetchSubscription extends AbstractSubscription { 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);