Class FixedRetryInfo
java.lang.Object
com.broadleafcommerce.common.messaging.retry.FixedRetryInfo
- Direct Known Subclasses:
BlockingFixedRetryInfo
,NonBlockingFixedRetryInfo
Retry configuration. Uses a fixed timeframe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The backOff timeframe to wait before retrying a message.getDlq()
Optional.Optional.Optional.int
The maximum number of retry attempts.int
hashCode()
void
setBackOff
(Duration backOff) The backOff timeframe to wait before retrying a message.void
Optional.void
setExclude
(List<Class<? extends Throwable>> exclude) Optional.void
setInclude
(List<Class<? extends Throwable>> include) Optional.void
setMaxAttempts
(int maxAttempts) The maximum number of retry attempts.toString()
-
Constructor Details
-
FixedRetryInfo
public FixedRetryInfo()
-
-
Method Details
-
getMaxAttempts
public int getMaxAttempts()The maximum number of retry attempts. Default is 3. -
getBackOff
The backOff timeframe to wait before retrying a message. Default is 3 seconds. -
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 likespring.cloud.stream.bindings.messageInputDlq.destination=messageDlq
, wheremessageDlq
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
Optional. The exception types that should be retried. If this andgetExclude()
are omitted, then all are allowed. -
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 andgetInclude()
are omitted, then all are allowed. -
setMaxAttempts
public void setMaxAttempts(int maxAttempts) The maximum number of retry attempts. Default is 3. -
setBackOff
The backOff timeframe to wait before retrying a message. Default is 3 seconds. -
setDlq
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 likespring.cloud.stream.bindings.messageInputDlq.destination=messageDlq
, wheremessageDlq
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
Optional. The exception types that should be retried. If this andgetExclude()
are omitted, then all are allowed. -
setExclude
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 andgetInclude()
are omitted, then all are allowed. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-