errorChannel
abstraction which could be used for publishing into the mentioned DLQ.
ErrorMessageStrategy
to let to build a specific error message which could be used to produce some target protocol even for a DLQ.
errorChannel
should be some how involved here if you don't want to let end-user to do something else before publishing elsewhere
protected void sendMessage(Message<?> messageArg) {
Message<?> message = messageArg;
if (message == null) {
throw new MessagingException("cannot send a null message");
}
message = trackMessageIfAny(message);
try {
this.messagingTemplate.send(getRequiredOutputChannel(), message);
}
catch (RuntimeException ex) {
if (!sendErrorMessageIfNecessary(message, ex)) {
throw ex;
}
}
}
sendErrorMessageIfNecessary()
?