Class RedeliveryPolicyDefinition

  • All Implemented Interfaces:
    Cloneable

    @Metadata(label="configuration")
    public class RedeliveryPolicyDefinition
    extends IdentifiedType
    implements Cloneable
    To configure re-delivery for error handling
    • Constructor Detail

      • RedeliveryPolicyDefinition

        public RedeliveryPolicyDefinition()
    • Method Detail

      • asyncDelayedRedelivery

        public RedeliveryPolicyDefinition asyncDelayedRedelivery()
        Allow asynchronous delayed redelivery. The route, in particular the consumer's component, must support the Asynchronous Routing Engine (e.g. seda).
        Returns:
        the builder
      • allowRedeliveryWhileStopping

        public RedeliveryPolicyDefinition allowRedeliveryWhileStopping​(boolean allowRedeliveryWhileStopping)
        Controls whether to allow redelivery while stopping/shutting down a route that uses error handling.
        Parameters:
        allowRedeliveryWhileStopping - true to allow redelivery, false to reject redeliveries
        Returns:
        the builder
      • allowRedeliveryWhileStopping

        public RedeliveryPolicyDefinition allowRedeliveryWhileStopping​(String allowRedeliveryWhileStopping)
        Controls whether to allow redelivery while stopping/shutting down a route that uses error handling.
        Parameters:
        allowRedeliveryWhileStopping - true to allow redelivery, false to reject redeliveries
        Returns:
        the builder
      • backOffMultiplier

        public RedeliveryPolicyDefinition backOffMultiplier​(double backOffMultiplier)
        Sets the back off multiplier
        Parameters:
        backOffMultiplier - the back off multiplier
        Returns:
        the builder
      • backOffMultiplier

        public RedeliveryPolicyDefinition backOffMultiplier​(String backOffMultiplier)
        Sets the back off multiplier (supports property placeholders)
        Parameters:
        backOffMultiplier - the back off multiplier
        Returns:
        the builder
      • collisionAvoidancePercent

        public RedeliveryPolicyDefinition collisionAvoidancePercent​(double collisionAvoidancePercent)
        Sets the collision avoidance percentage
        Parameters:
        collisionAvoidancePercent - the percentage
        Returns:
        the builder
      • collisionAvoidanceFactor

        public RedeliveryPolicyDefinition collisionAvoidanceFactor​(double collisionAvoidanceFactor)
        Sets the collision avoidance factor
        Parameters:
        collisionAvoidanceFactor - the factor
        Returns:
        the builder
      • collisionAvoidanceFactor

        public RedeliveryPolicyDefinition collisionAvoidanceFactor​(String collisionAvoidanceFactor)
        Sets the collision avoidance factor (supports property placeholders)
        Parameters:
        collisionAvoidanceFactor - the factor
        Returns:
        the builder
      • redeliveryDelay

        public RedeliveryPolicyDefinition redeliveryDelay​(long delay)
        Sets the initial redelivery delay
        Parameters:
        delay - delay in millis
        Returns:
        the builder
      • redeliveryDelay

        public RedeliveryPolicyDefinition redeliveryDelay​(String delay)
        Sets the initial redelivery delay (supports property placeholders)
        Parameters:
        delay - delay in millis
        Returns:
        the builder
      • retriesExhaustedLogLevel

        public RedeliveryPolicyDefinition retriesExhaustedLogLevel​(org.apache.camel.LoggingLevel retriesExhaustedLogLevel)
        Sets the logging level to use when retries have been exhausted
        Parameters:
        retriesExhaustedLogLevel - the logging level
        Returns:
        the builder
      • retriesExhaustedLogLevel

        public RedeliveryPolicyDefinition retriesExhaustedLogLevel​(String retriesExhaustedLogLevel)
        Sets the logging level to use when retries have been exhausted
        Parameters:
        retriesExhaustedLogLevel - the logging level
        Returns:
        the builder
      • retryAttemptedLogLevel

        public RedeliveryPolicyDefinition retryAttemptedLogLevel​(org.apache.camel.LoggingLevel retryAttemptedLogLevel)
        Sets the logging level to use for logging retry attempts
        Parameters:
        retryAttemptedLogLevel - the logging level
        Returns:
        the builder
      • retryAttemptedLogLevel

        public RedeliveryPolicyDefinition retryAttemptedLogLevel​(String retryAttemptedLogLevel)
        Sets the logging level to use for logging retry attempts
        Parameters:
        retryAttemptedLogLevel - the logging level
        Returns:
        the builder
      • retryAttemptedLogInterval

        public RedeliveryPolicyDefinition retryAttemptedLogInterval​(String retryAttemptedLogInterval)
        Sets the interval to use for logging retry attempts
        Parameters:
        retryAttemptedLogInterval - the retry logging interval
        Returns:
        the builder
      • logStackTrace

        public RedeliveryPolicyDefinition logStackTrace​(boolean logStackTrace)
        Sets whether stack traces should be logged. Can be used to include or reduce verbose.
        Parameters:
        logStackTrace - whether stack traces should be logged or not
        Returns:
        the builder
      • logStackTrace

        public RedeliveryPolicyDefinition logStackTrace​(String logStackTrace)
        Sets whether stack traces should be logged (supports property placeholders) Can be used to include or reduce verbose.
        Parameters:
        logStackTrace - whether stack traces should be logged or not
        Returns:
        the builder
      • logRetryStackTrace

        public RedeliveryPolicyDefinition logRetryStackTrace​(boolean logRetryStackTrace)
        Sets whether stack traces should be logged when an retry attempt failed. Can be used to include or reduce verbose.
        Parameters:
        logRetryStackTrace - whether stack traces should be logged or not
        Returns:
        the builder
      • logRetryStackTrace

        public RedeliveryPolicyDefinition logRetryStackTrace​(String logRetryStackTrace)
        Sets whether stack traces should be logged when an retry attempt failed (supports property placeholders). Can be used to include or reduce verbose.
        Parameters:
        logRetryStackTrace - whether stack traces should be logged or not
        Returns:
        the builder
      • logRetryAttempted

        public RedeliveryPolicyDefinition logRetryAttempted​(boolean logRetryAttempted)
        Sets whether retry attempts should be logged or not. Can be used to include or reduce verbose.
        Parameters:
        logRetryAttempted - whether retry attempts should be logged or not
        Returns:
        the builder
      • logRetryAttempted

        public RedeliveryPolicyDefinition logRetryAttempted​(String logRetryAttempted)
        Sets whether retry attempts should be logged or not (supports property placeholders). Can be used to include or reduce verbose.
        Parameters:
        logRetryAttempted - whether retry attempts should be logged or not
        Returns:
        the builder
      • logHandled

        public RedeliveryPolicyDefinition logHandled​(boolean logHandled)
        Sets whether handled exceptions should be logged or not. Can be used to include or reduce verbose.
        Parameters:
        logHandled - whether handled exceptions should be logged or not
        Returns:
        the builder
      • logHandled

        public RedeliveryPolicyDefinition logHandled​(String logHandled)
        Sets whether handled exceptions should be logged or not (supports property placeholders). Can be used to include or reduce verbose.
        Parameters:
        logHandled - whether handled exceptions should be logged or not
        Returns:
        the builder
      • logNewException

        public RedeliveryPolicyDefinition logNewException​(boolean logNewException)
        Sets whether new exceptions should be logged or not. Can be used to include or reduce verbose.

        A new exception is an exception that was thrown while handling a previous exception.

        Parameters:
        logNewException - whether new exceptions should be logged or not
        Returns:
        the builder
      • logNewException

        public RedeliveryPolicyDefinition logNewException​(String logNewException)
        Sets whether new exceptions should be logged or not (supports property placeholders). Can be used to include or reduce verbose.

        A new exception is an exception that was thrown while handling a previous exception.

        Parameters:
        logNewException - whether new exceptions should be logged or not
        Returns:
        the builder
      • logContinued

        public RedeliveryPolicyDefinition logContinued​(boolean logContinued)
        Sets whether continued exceptions should be logged or not. Can be used to include or reduce verbose.
        Parameters:
        logContinued - whether continued exceptions should be logged or not
        Returns:
        the builder
      • logContinued

        public RedeliveryPolicyDefinition logContinued​(String logContinued)
        Sets whether continued exceptions should be logged or not (supports property placeholders). Can be used to include or reduce verbose.
        Parameters:
        logContinued - whether continued exceptions should be logged or not
        Returns:
        the builder
      • logExhausted

        public RedeliveryPolicyDefinition logExhausted​(boolean logExhausted)
        Sets whether exhausted exceptions should be logged or not. Can be used to include or reduce verbose.
        Parameters:
        logExhausted - whether exhausted exceptions should be logged or not
        Returns:
        the builder
      • logExhausted

        public RedeliveryPolicyDefinition logExhausted​(String logExhausted)
        Sets whether exhausted exceptions should be logged or not (supports property placeholders). Can be used to include or reduce verbose.
        Parameters:
        logExhausted - whether exhausted exceptions should be logged or not
        Returns:
        the builder
      • logExhaustedMessageHistory

        public RedeliveryPolicyDefinition logExhaustedMessageHistory​(boolean logExhaustedMessageHistory)
        Sets whether exhausted exceptions should be logged including message history or not (supports property placeholders). Can be used to include or reduce verbose.
        Parameters:
        logExhaustedMessageHistory - whether exhausted exceptions should be logged with message history
        Returns:
        the builder
      • logExhaustedMessageHistory

        public RedeliveryPolicyDefinition logExhaustedMessageHistory​(String logExhaustedMessageHistory)
        Sets whether exhausted exceptions should be logged including message history or not (supports property placeholders). Can be used to include or reduce verbose.
        Parameters:
        logExhaustedMessageHistory - whether exhausted exceptions should be logged with message history
        Returns:
        the builder
      • logExhaustedMessageBody

        public RedeliveryPolicyDefinition logExhaustedMessageBody​(boolean logExhaustedMessageBody)
        Sets whether exhausted message body should be logged including message history or not (supports property placeholders). Can be used to include or reduce verbose. Requires logExhaustedMessageHistory to be enabled.
        Parameters:
        logExhaustedMessageBody - whether exhausted message body should be logged with message history
        Returns:
        the builder
      • logExhaustedMessageBody

        public RedeliveryPolicyDefinition logExhaustedMessageBody​(String logExhaustedMessageBody)
        Sets whether exhausted message body should be logged including message history or not (supports property placeholders). Can be used to include or reduce verbose. Requires logExhaustedMessageHistory to be enabled.
        Parameters:
        logExhaustedMessageBody - whether exhausted message body should be logged with message history
        Returns:
        the builder
      • maximumRedeliveries

        public RedeliveryPolicyDefinition maximumRedeliveries​(int maximumRedeliveries)
        Sets the maximum redeliveries
        • x = redeliver at most x times
        • 0 = no redeliveries
        • -1 = redeliver forever
        Parameters:
        maximumRedeliveries - the value
        Returns:
        the builder
      • maximumRedeliveries

        public RedeliveryPolicyDefinition maximumRedeliveries​(String maximumRedeliveries)
        Sets the maximum redeliveries (supports property placeholders)
        • x = redeliver at most x times
        • 0 = no redeliveries
        • -1 = redeliver forever
        Parameters:
        maximumRedeliveries - the value
        Returns:
        the builder
      • useCollisionAvoidance

        public RedeliveryPolicyDefinition useCollisionAvoidance()
        Turn on collision avoidance.
        Returns:
        the builder
      • useExponentialBackOff

        public RedeliveryPolicyDefinition useExponentialBackOff()
        Turn on exponential backk off
        Returns:
        the builder
      • maximumRedeliveryDelay

        public RedeliveryPolicyDefinition maximumRedeliveryDelay​(long maximumRedeliveryDelay)
        Sets the maximum delay between redelivery
        Parameters:
        maximumRedeliveryDelay - the delay in millis
        Returns:
        the builder
      • maximumRedeliveryDelay

        public RedeliveryPolicyDefinition maximumRedeliveryDelay​(String maximumRedeliveryDelay)
        Sets the maximum delay between redelivery (supports property placeholders)
        Parameters:
        maximumRedeliveryDelay - the delay in millis
        Returns:
        the builder
      • delayPattern

        public RedeliveryPolicyDefinition delayPattern​(String delayPattern)
        Sets the delay pattern with delay intervals.
        Parameters:
        delayPattern - the delay pattern
        Returns:
        the builder
      • exchangeFormatterRef

        public RedeliveryPolicyDefinition exchangeFormatterRef​(String exchangeFormatterRef)
        Sets the reference of the instance of ExchangeFormatter to generate the log message from exchange.
        Parameters:
        exchangeFormatterRef - name of the instance of ExchangeFormatter
        Returns:
        the builder
      • getMaximumRedeliveries

        public String getMaximumRedeliveries()
      • setMaximumRedeliveries

        public void setMaximumRedeliveries​(String maximumRedeliveries)
      • getRedeliveryDelay

        public String getRedeliveryDelay()
      • setRedeliveryDelay

        public void setRedeliveryDelay​(String redeliveryDelay)
      • getAsyncDelayedRedelivery

        public String getAsyncDelayedRedelivery()
      • setAsyncDelayedRedelivery

        public void setAsyncDelayedRedelivery​(String asyncDelayedRedelivery)
      • getBackOffMultiplier

        public String getBackOffMultiplier()
      • setBackOffMultiplier

        public void setBackOffMultiplier​(String backOffMultiplier)
      • getUseExponentialBackOff

        public String getUseExponentialBackOff()
      • setUseExponentialBackOff

        public void setUseExponentialBackOff​(String useExponentialBackOff)
      • getCollisionAvoidanceFactor

        public String getCollisionAvoidanceFactor()
      • setCollisionAvoidanceFactor

        public void setCollisionAvoidanceFactor​(String collisionAvoidanceFactor)
      • getUseCollisionAvoidance

        public String getUseCollisionAvoidance()
      • setUseCollisionAvoidance

        public void setUseCollisionAvoidance​(String useCollisionAvoidance)
      • getMaximumRedeliveryDelay

        public String getMaximumRedeliveryDelay()
      • setMaximumRedeliveryDelay

        public void setMaximumRedeliveryDelay​(String maximumRedeliveryDelay)
      • getRetriesExhaustedLogLevel

        public String getRetriesExhaustedLogLevel()
      • setRetriesExhaustedLogLevel

        public void setRetriesExhaustedLogLevel​(String retriesExhaustedLogLevel)
      • getRetryAttemptedLogLevel

        public String getRetryAttemptedLogLevel()
      • setRetryAttemptedLogLevel

        public void setRetryAttemptedLogLevel​(String retryAttemptedLogLevel)
      • getRetryAttemptedLogInterval

        public String getRetryAttemptedLogInterval()
      • setRetryAttemptedLogInterval

        public void setRetryAttemptedLogInterval​(String retryAttemptedLogInterval)
      • getLogRetryAttempted

        public String getLogRetryAttempted()
      • setLogRetryAttempted

        public void setLogRetryAttempted​(String logRetryAttempted)
      • getLogStackTrace

        public String getLogStackTrace()
      • setLogStackTrace

        public void setLogStackTrace​(String logStackTrace)
      • getLogRetryStackTrace

        public String getLogRetryStackTrace()
      • setLogRetryStackTrace

        public void setLogRetryStackTrace​(String logRetryStackTrace)
      • getLogHandled

        public String getLogHandled()
      • setLogHandled

        public void setLogHandled​(String logHandled)
      • getLogNewException

        public String getLogNewException()
      • setLogNewException

        public void setLogNewException​(String logNewException)
      • getLogContinued

        public String getLogContinued()
      • setLogContinued

        public void setLogContinued​(String logContinued)
      • getLogExhausted

        public String getLogExhausted()
      • setLogExhausted

        public void setLogExhausted​(String logExhausted)
      • getLogExhaustedMessageHistory

        public String getLogExhaustedMessageHistory()
      • setLogExhaustedMessageHistory

        public void setLogExhaustedMessageHistory​(String logExhaustedMessageHistory)
      • getLogExhaustedMessageBody

        public String getLogExhaustedMessageBody()
      • setLogExhaustedMessageBody

        public void setLogExhaustedMessageBody​(String logExhaustedMessageBody)
      • getDisableRedelivery

        public String getDisableRedelivery()
      • setDisableRedelivery

        public void setDisableRedelivery​(String disableRedelivery)
        Disables redelivery (same as setting maximum redeliveries to 0)
      • getDelayPattern

        public String getDelayPattern()
      • setDelayPattern

        public void setDelayPattern​(String delayPattern)
      • getAllowRedeliveryWhileStopping

        public String getAllowRedeliveryWhileStopping()
      • setAllowRedeliveryWhileStopping

        public void setAllowRedeliveryWhileStopping​(String allowRedeliveryWhileStopping)
      • getExchangeFormatterRef

        public String getExchangeFormatterRef()
      • setExchangeFormatterRef

        public void setExchangeFormatterRef​(String exchangeFormatterRef)