Class ErrorMessageSendingRecoverer
java.lang.Object
org.springframework.integration.core.ErrorMessagePublisher
org.springframework.integration.handler.advice.ErrorMessageSendingRecoverer
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- org.springframework.retry.RecoveryCallback<Object>
public class ErrorMessageSendingRecoverer
extends ErrorMessagePublisher
implements org.springframework.retry.RecoveryCallback<Object>
A 
RecoveryCallback that sends the final throwable as an
 ErrorMessage after
 retry exhaustion.- Since:
- 2.2
- Author:
- Gary Russell, Artem Bilan, Oleg Zhurakousky
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic class
- 
Field SummaryFields inherited from class org.springframework.integration.core.ErrorMessagePublisherlogger, messagingTemplate
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct instance with the defaulterrorChannelto publish recovery error message.Construct instance based on the provided message channel.ErrorMessageSendingRecoverer(MessageChannel channel, ErrorMessageStrategy errorMessageStrategy) Construct instance based on the provided message channel andErrorMessageStrategy.
- 
Method SummaryModifier and TypeMethodDescriptionprotected ThrowablepayloadWhenNull(AttributeAccessor context) Build aThrowable payloadbased on the provided context for futureErrorMessagewhen there is originalThrowable.recover(org.springframework.retry.RetryContext context) Methods inherited from class org.springframework.integration.core.ErrorMessagePublisherdeterminePayload, getChannel, getChannelResolver, getErrorMessageStrategy, getMessagingTemplate, publish, publish, publish, publish, publish, setBeanFactory, setChannel, setChannelName, setChannelResolver, setErrorMessageStrategy, setSendTimeout
- 
Constructor Details- 
ErrorMessageSendingRecovererpublic ErrorMessageSendingRecoverer()Construct instance with the defaulterrorChannelto publish recovery error message. TheDefaultErrorMessageStrategyis used for building error message to publish.- Since:
- 4.3.10
 
- 
ErrorMessageSendingRecovererConstruct instance based on the provided message channel. TheDefaultErrorMessageStrategyis used for building error message to publish.- Parameters:
- channel- the message channel to publish error messages on recovery action.
 
- 
ErrorMessageSendingRecovererpublic ErrorMessageSendingRecoverer(MessageChannel channel, ErrorMessageStrategy errorMessageStrategy) Construct instance based on the provided message channel andErrorMessageStrategy. In the event providedErrorMessageStrategyis null, theDefaultErrorMessageStrategywill be used.- Parameters:
- channel- the message channel to publish error messages on recovery action.
- errorMessageStrategy- the- ErrorMessageStrategyto build error message for publishing. Can be null at which point the- DefaultErrorMessageStrategyis used.
- Since:
- 4.3.10
 
 
- 
- 
Method Details- 
recover
- 
payloadWhenNullDescription copied from class:ErrorMessagePublisherBuild aThrowable payloadbased on the provided context for futureErrorMessagewhen there is originalThrowable.- Overrides:
- payloadWhenNullin class- ErrorMessagePublisher
- Parameters:
- context- the- AttributeAccessorto use for exception properties.
- Returns:
- the Throwablefor anErrorMessagepayload.
- See Also:
 
 
-