Class NonBlockingRetryProperties
java.lang.Object
com.broadleafcommerce.common.messaging.retry.nonblocking.NonBlockingRetryProperties
@ConfigurationProperties("broadleaf.messaging.nonblocking.retry.cloud.stream")
public class NonBlockingRetryProperties
extends Object
Configuration for non-blocking retries for Spring Cloud Stream message processing. Spring does
not offer a non-blocking option directly in Spring Cloud Stream, so this serves as a custom
implementation. The approach is similar in design to that provided by
org.springframework.kafka.annotation.RetryableTopic
. However, rather than auto create
bindings, this implementation simply allows pointing to an existing Spring Cloud Stream binding
configurations for the required retries. This allows each binding to be freely configured in
whatever way makes the most sense for the use case. This approach should work for any Spring
Cloud Stream binder (not just Kafka).
Note - Consuming batches is not currently supported with this configuration.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The amount of time to wait between polling attempts when consuming the retry bindings defined ingetBindings()
.The ordered list of retry configurations associated by the original consumer bindingint
hashCode()
boolean
Whether the non-blocking retry feature is enabledvoid
setBackOffCheckInterval
(Duration backOffCheckInterval) The amount of time to wait between polling attempts when consuming the retry bindings defined ingetBindings()
.void
setBindings
(Map<String, List<NonBlockingFixedRetryInfo>> bindings) The ordered list of retry configurations associated by the original consumer bindingvoid
setEnabled
(boolean enabled) Whether the non-blocking retry feature is enabledvoid
toString()
-
Field Details
-
PREFIX
- See Also:
-
ENABLED_PROP
- See Also:
-
-
Constructor Details
-
NonBlockingRetryProperties
public NonBlockingRetryProperties()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Whether the non-blocking retry feature is enabled -
getBackOffCheckInterval
The amount of time to wait between polling attempts when consuming the retry bindings defined ingetBindings()
. This can be a somewhat relaxed value and does not need to be as frequent as a normal message channel polling interval. Note, this is different (and generally shorter than)FixedRetryInfo.getBackOff()
. Default is 15000 ms. Does not apply to all binder implementations. In the case of Kafka, this relates toorg.springframework.kafka.support.Acknowledgment#nack(Duration)
where the sleep duration will be the longest of eitherbackOffCheckInterval
, ormaxPollInterval
. The defaultmaxPollInterval
is 5 seconds. -
getBindings
The ordered list of retry configurations associated by the original consumer binding- See Also:
-
getPubSub
-
setEnabled
public void setEnabled(boolean enabled) Whether the non-blocking retry feature is enabled -
setBackOffCheckInterval
The amount of time to wait between polling attempts when consuming the retry bindings defined ingetBindings()
. This can be a somewhat relaxed value and does not need to be as frequent as a normal message channel polling interval. Note, this is different (and generally shorter than)FixedRetryInfo.getBackOff()
. Default is 15000 ms. Does not apply to all binder implementations. In the case of Kafka, this relates toorg.springframework.kafka.support.Acknowledgment#nack(Duration)
where the sleep duration will be the longest of eitherbackOffCheckInterval
, ormaxPollInterval
. The defaultmaxPollInterval
is 5 seconds. -
setBindings
The ordered list of retry configurations associated by the original consumer binding- See Also:
-
setPubSub
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-