Class FixedRetryInfo

java.lang.Object
com.broadleafcommerce.common.messaging.retry.FixedRetryInfo
Direct Known Subclasses:
BlockingFixedRetryInfo, NonBlockingFixedRetryInfo

public class FixedRetryInfo extends Object
Retry configuration. Uses a fixed timeframe.
  • Constructor Details

    • FixedRetryInfo

      public FixedRetryInfo()
  • Method Details

    • getMaxAttempts

      public int getMaxAttempts()
      The maximum number of retry attempts. Default is 3.
    • getBackOff

      public Duration getBackOff()
      The backOff timeframe to wait before retrying a message. Default is 3 seconds.
    • getDlq

      public String getDlq()
      Optional. The name of a broker channel to which messages that fail all non-blocking retries should be sent. This value is usually set on the final FixedRetryInfo in a sequence (or the first if only a single member sequence is used). Note, this is the name of the destination in the broker - not the channel binding name. For example, an input channel definition for an example dlq might look like spring.cloud.stream.bindings.messageInputDlq.destination=messageDlq, where messageDlq would be the value used for this property. If no dlq is provided, the final exceptional state is merely logged.

      Note - the system does not automatically create consumer bindings for the dlq. If you wish to consumer dead letters, you will need to independently configure bindings and write processing logic separately.

    • getInclude

      public List<Class<? extends Throwable>> getInclude()
      Optional. The exception types that should be retried. If this and getExclude() are omitted, then all are allowed.
    • getExclude

      public List<Class<? extends Throwable>> getExclude()
      Optional. The exception types that should not be retried. When the message processing throws these exceptions the message goes straight to the DLQ (or is logged). If this and getInclude() are omitted, then all are allowed.
    • setMaxAttempts

      public void setMaxAttempts(int maxAttempts)
      The maximum number of retry attempts. Default is 3.
    • setBackOff

      public void setBackOff(Duration backOff)
      The backOff timeframe to wait before retrying a message. Default is 3 seconds.
    • setDlq

      public void setDlq(String dlq)
      Optional. The name of a broker channel to which messages that fail all non-blocking retries should be sent. This value is usually set on the final FixedRetryInfo in a sequence (or the first if only a single member sequence is used). Note, this is the name of the destination in the broker - not the channel binding name. For example, an input channel definition for an example dlq might look like spring.cloud.stream.bindings.messageInputDlq.destination=messageDlq, where messageDlq would be the value used for this property. If no dlq is provided, the final exceptional state is merely logged.

      Note - the system does not automatically create consumer bindings for the dlq. If you wish to consumer dead letters, you will need to independently configure bindings and write processing logic separately.

    • setInclude

      public void setInclude(List<Class<? extends Throwable>> include)
      Optional. The exception types that should be retried. If this and getExclude() are omitted, then all are allowed.
    • setExclude

      public void setExclude(List<Class<? extends Throwable>> exclude)
      Optional. The exception types that should not be retried. When the message processing throws these exceptions the message goes straight to the DLQ (or is logged). If this and getInclude() are omitted, then all are allowed.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object