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.setAsyncDispatch(isAsyncDispatch());
|
||||||
connection.setUseAsyncSend(isUseAsyncSend());
|
connection.setUseAsyncSend(isUseAsyncSend());
|
||||||
connection.setUseRetroactiveConsumer(isUseRetroactiveConsumer());
|
connection.setUseRetroactiveConsumer(isUseRetroactiveConsumer());
|
||||||
connection.setRedeliveryPolicy(getRedeliveryPolicy());
|
if (getRedeliveryPolicy() != null) {
|
||||||
|
connection.setRedeliveryPolicy(getRedeliveryPolicy());
|
||||||
|
}
|
||||||
|
|
||||||
if( clientID !=null )
|
if( clientID !=null )
|
||||||
connection.setClientID(clientID);
|
connection.setClientID(clientID);
|
||||||
|
|
|
@ -175,11 +175,14 @@ abstract public class PrefetchSubscription extends AbstractSubscription {
|
||||||
Message message = node.getMessage();
|
Message message = node.getMessage();
|
||||||
if( message !=null ) {
|
if( message !=null ) {
|
||||||
|
|
||||||
// TODO is this meant to be == null - it was != ?
|
// TODO is this meant to be == null?
|
||||||
if( message.getOriginalDestination()==null )
|
if( message.getOriginalDestination()!=null )
|
||||||
message.setOriginalDestination(message.getDestination());
|
message.setOriginalDestination(message.getDestination());
|
||||||
|
|
||||||
ActiveMQDestination originalDestination = message.getOriginalDestination();
|
ActiveMQDestination originalDestination = message.getOriginalDestination();
|
||||||
|
if (originalDestination == null) {
|
||||||
|
originalDestination = message.getDestination();
|
||||||
|
}
|
||||||
DeadLetterStrategy deadLetterStrategy = node.getRegionDestination().getDeadLetterStrategy();
|
DeadLetterStrategy deadLetterStrategy = node.getRegionDestination().getDeadLetterStrategy();
|
||||||
ActiveMQDestination deadLetterDestination = deadLetterStrategy.getDeadLetterQueueFor(originalDestination);
|
ActiveMQDestination deadLetterDestination = deadLetterStrategy.getDeadLetterQueueFor(originalDestination);
|
||||||
message.setDestination(deadLetterDestination);
|
message.setDestination(deadLetterDestination);
|
||||||
|
|
Loading…
Reference in New Issue