final TransactionLogResource owningResource = rejectedQueueEntry.getOwningResource();
if(owningResource instanceof AMQQueue)
{
final AMQQueue queue = (AMQQueue) owningResource;
final Exchange altExchange = queue.getAlternateExchange();
if (altExchange == null)
{
_logger.debug("No alternate exchange configured for queue, must discard the message as unable to DLQ: delivery tag: " + deliveryTag);
getVirtualHost().getEventLogger().message(_logSubject,
ChannelMessages.DISCARDMSG_NOALTEXCH(msg.getMessageNumber(),
queue.getName(),
msg.getInitialRoutingAddress()));
}
else
{
_logger.debug(
"Routing process provided no queues to enqueue the message on, must discard message as unable to DLQ: delivery tag: "
+ deliveryTag);
getVirtualHost().getEventLogger().message(_logSubject,
ChannelMessages.DISCARDMSG_NOROUTE(msg.getMessageNumber(),
altExchange.getName()));
}
}
}
}