Interface FailurePolicy

All Superinterfaces:
Prototype.Api

public sealed interface FailurePolicy extends Prototype.Api
Portable incoming delivery failure policy.
See Also:
  • Method Details

    • builder

      static FailurePolicy.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static FailurePolicy.Builder builder(FailurePolicy instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static FailurePolicy create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static FailurePolicy create()
      Create a new instance with default values.
      Returns:
      a new instance
    • retry

      Retry retry()
      Fault tolerance retry instance used for incoming delivery. When no retry is supplied, all default policies share one messaging retry instance with Integer.MAX_VALUE calls, a one-second initial delay, factor-two exponential backoff, no jitter, a one-minute maximum delay, a practically unbounded timeout, and disabled instance metrics.

      An explicitly configured or programmatically supplied retry is complete and is used as supplied. Options omitted within an explicit retry use fault-tolerance defaults, without inheriting messaging defaults.

      Returns:
      retry instance
    • onExhausted

      FailureDisposition onExhausted()
      Terminal disposition after delivery attempts are exhausted; dead letter requires a target channel. A pre-dispatch mapping failure reported through ConnectorDeliveryReservation.startFailed(MessageBatch, RuntimeException) or ConnectorDeliveryReservation.tryStartFailed(MessageBatch, RuntimeException) is always treated as exhausted after its initial attempt because the runtime cannot repeat transport mapping.
      Returns:
      terminal disposition
    • deadLetter

      Optional<DeadLetterConfig> deadLetter()
      Dead-letter delivery configuration; required for FailureDisposition.DEAD_LETTER and invalid for other dispositions.

      Runtime validation covers the logical channel graph. It cannot detect when distinct connector bindings resolve to the same transport destination, such as two Kafka channels configured with the same topic. A dead-letter target must not resolve back to the source connector.

      Returns:
      dead-letter configuration