Class BlockingRetryErrorHandler

java.lang.Object
com.broadleafcommerce.common.messaging.retry.blocking.BlockingRetryErrorHandler
All Implemented Interfaces:
Consumer<org.springframework.messaging.support.ErrorMessage>

public class BlockingRetryErrorHandler extends Object implements Consumer<org.springframework.messaging.support.ErrorMessage>
Error handler for the blocking retry case. Only applies to the in-memory Spring retry case after all retry attempts have been exhausted. Does not apply in kafka when BlockingFixedRetryInfo.Kafka.isSeekToCurrentRecordOnFailure() is true, in which case, DefaultErrorHandler and KafkaBlockingRetryDeadLetterRecoverer are in play instead.
See Also:
  • Constructor Details

    • BlockingRetryErrorHandler

      public BlockingRetryErrorHandler(String originalConsumerBinding, String group, BlockingRetryProperties blockingRetryProperties, com.broadleafcommerce.common.extension.compatibility.support.messaging.TimeoutAwareStreamBridge streamBridge, org.springframework.core.convert.converter.Converter<String,String> traceTruncator)
  • Method Details

    • accept

      public void accept(org.springframework.messaging.support.ErrorMessage errorMessage)
      Specified by:
      accept in interface Consumer<org.springframework.messaging.support.ErrorMessage>
    • sendToDlq

      protected void sendToDlq(BlockingFixedRetryInfo info, org.springframework.messaging.support.ErrorMessage errorMessage, org.springframework.messaging.Message<?> original)
      Send the message to the DLQ.
      Parameters:
      info - The blocking retry configuration
      errorMessage - The failed message
      original - The original message
    • getRoot

      protected Exception getRoot(Exception e)
      Retrieve the relevant root exception for reporting as a header on the message
      Parameters:
      e - The exception
      Returns:
      The relevant root exception