Annotation Interface Messaging.OnFailure
- Enclosing class:
Messaging
Declares default delivery failure handling for the incoming channel named by
Messaging.ReceiveFrom.
The policy is channel- and delivery-scoped, so it covers sibling handlers and downstream outputs participating
in the same source delivery rather than only the annotated method invocation. An explicitly configured
failure option for the incoming channel overrides the corresponding declared option. Configuring
failure.retry replaces the complete retry declared by this annotation.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionLogical channel used for dead-letter delivery.intMaximum total delivery attempts, including the initial attempt.Terminal disposition after delivery attempts are exhausted.Delay before retrying a failed delivery, inDurationformat.
-
Element Details
-
retryDelay
String retryDelayDelay before retrying a failed delivery, inDurationformat. This populates the retry prototype'sRetryConfig.delay().- Returns:
- retry delay
- Default:
"PT1S"
-
maxAttempts
int maxAttemptsMaximum total delivery attempts, including the initial attempt. Zero uses the messaging default ofInteger.MAX_VALUEcalls. Positive values populate the retry prototype'sRetryConfig.calls(). A pre-dispatch mapping failure reported throughConnectorDeliveryReservation.startFailed(MessageBatch, RuntimeException)orConnectorDeliveryReservation.tryStartFailed(MessageBatch, RuntimeException)is treated as exhausted after its initial attempt because the runtime cannot repeat transport mapping.- Returns:
- maximum delivery attempts, or zero for the messaging default
- Default:
0
-
onExhausted
FailureDisposition onExhaustedTerminal disposition after delivery attempts are exhausted.- Returns:
- terminal disposition
- Default:
FAIL
-
deadLetterChannel
String deadLetterChannelLogical channel used for dead-letter delivery. This is required forFailureDisposition.DEAD_LETTERand is not valid for other dispositions. A non-empty value populatesDeadLetterConfig.channel().- Returns:
- dead-letter channel, or an empty string when none is declared
- Default:
""
-