INT-4328: AMQP: Returns/Nacks: Create ErrorMessage
JIRA: https://jira.spring.io/browse/INT-4328 Add support for sending `ErrorMessage`s to the return and nack channels. **cherry-pick to 4.3.x, but change default EMS to null (will require minor adjustment to test - set the EMS in `adapterWithReturnsAndErrorMessageStrategy`)**
This commit is contained in:
committed by
Artem Bilan
parent
d41d707357
commit
0a1306cd1b
@@ -37,7 +37,8 @@ public class DefaultErrorMessageStrategy implements ErrorMessageStrategy {
|
||||
|
||||
@Override
|
||||
public ErrorMessage buildErrorMessage(Throwable throwable, AttributeAccessor attributes) {
|
||||
Object inputMessage = attributes.getAttribute(ErrorMessageUtils.INPUT_MESSAGE_CONTEXT_KEY);
|
||||
Object inputMessage = attributes == null ? null
|
||||
: attributes.getAttribute(ErrorMessageUtils.INPUT_MESSAGE_CONTEXT_KEY);
|
||||
return new ErrorMessage(throwable, inputMessage instanceof Message ? (Message<?>) inputMessage : null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user