Class BackOffAwareRetryConsumer
java.lang.Object
com.broadleafcommerce.common.messaging.retry.BackOffAwareRetryConsumer
- Direct Known Subclasses:
KafkaNonBlockingRetryConsumer
,PubSubDelayedRetryConsumer
Support for all non-blocking retry consumer implementations (per-binder)
-
Constructor Summary
ConstructorsConstructorDescriptionBackOffAwareRetryConsumer
(com.broadleafcommerce.common.extension.compatibility.support.messaging.TimeoutAwareStreamBridge streamBridge) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isBackOffSatisfied
(org.springframework.messaging.Message<?> message) Inspect the message and detect if the backoff period has expired via theConstants.Header.NEXT_ATTEMPT_TIMESTAMP_HEADER
header.protected void
resend
(org.springframework.messaging.Message<?> message) Send the message to the original consumer binding for re-processing.protected <S> org.springframework.messaging.support.MessageBuilder<S>
reset
(org.springframework.messaging.support.MessageBuilder<S> builder, org.springframework.messaging.Message<?> message) Perform last minute adjustments before resending the message to the original consumer binding
-
Constructor Details
-
BackOffAwareRetryConsumer
public BackOffAwareRetryConsumer(com.broadleafcommerce.common.extension.compatibility.support.messaging.TimeoutAwareStreamBridge streamBridge)
-
-
Method Details
-
isBackOffSatisfied
protected boolean isBackOffSatisfied(org.springframework.messaging.Message<?> message) Inspect the message and detect if the backoff period has expired via theConstants.Header.NEXT_ATTEMPT_TIMESTAMP_HEADER
header.- Parameters:
message
- The message to inspect for backoff fulfillment- Returns:
- Whether the backoff period has been satisfied
-
resend
protected void resend(org.springframework.messaging.Message<?> message) Send the message to the original consumer binding for re-processing. Detect the identity of the consumer binding via theConstants.Header.ORIGINAL_PRODUCER_BINDING_HEADER
header.- Parameters:
message
- The message to resend
-
reset
protected <S> org.springframework.messaging.support.MessageBuilder<S> reset(org.springframework.messaging.support.MessageBuilder<S> builder, org.springframework.messaging.Message<?> message) Perform last minute adjustments before resending the message to the original consumer binding- Type Parameters:
S
- The type of message- Parameters:
builder
- The message builder for the message to sendmessage
- The original message that serves as an information source- Returns:
- The modified message builder
-