mirror of https://github.com/apache/activemq.git
avoid possible NPE; only set the redeliveryPolicy if there is one configured
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@360132 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
80f5e0ced1
commit
de7f650b16
|
@ -210,7 +210,9 @@ public class ActiveMQConnectionFactory implements ConnectionFactory, QueueConnec
|
|||
connection.setAsyncDispatch(isAsyncDispatch());
|
||||
connection.setUseAsyncSend(isUseAsyncSend());
|
||||
connection.setUseRetroactiveConsumer(isUseRetroactiveConsumer());
|
||||
if (getRedeliveryPolicy() != null) {
|
||||
connection.setRedeliveryPolicy(getRedeliveryPolicy());
|
||||
}
|
||||
|
||||
if( clientID !=null )
|
||||
connection.setClientID(clientID);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue