Actually send the message to NMR.
try {
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST,
"Sending the message " + getMessageExchange() + "to NMR");
}
boolean sendSync = shouldSendSync(getMessageExchange());
if(sendSync) {
getDeliveryChannel().sendSync(getMessageExchange());
} else {
getDeliveryChannel().send(getMessageExchange());
}
if (getMessageExchange().getStatus()== ExchangeStatus.ERROR &&
getMessageExchange().getRole().equals(MessageExchange.Role.CONSUMER))
setException(getMessageExchange().getError());
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST,
"Sent message " + getMessageExchange() + "to NMR");
}
} catch (MessagingException me) {
logger.log(Level.WARNING, "Error sending message" + me.getMessage());
setException(me);
}