Interface FailureHandler

All Known Implementing Classes:
DefaultFailureHandler

public interface FailureHandler
A handler for failures, occurring at different stages of message processing (e.g. pipeline processing, extraction, Elasticsearch indexing). To register a handler implementation you need to inform Guice about the new dependency via Multibinder:

 Multibinder<FailureHandler> failureHandlerBinder = Multibinder.newSetBinder(binder(), FailureHandler.class);
 failureHandlerBinder.addBinding().to(MyCustomFailureHandler.class);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(FailureBatch failureBatch)
    Handles a batch of failures
    boolean
    Guides the main failure handling service, when deciding whether this handler is available for processing.
    boolean
    supports(FailureBatch failureBatch)
    Guides the main failure handling service, when deciding whether this handler is suitable for a certain batch of failures
  • Method Details

    • handle

      void handle(FailureBatch failureBatch)
      Handles a batch of failures
      Parameters:
      failureBatch - a batch of failures, supported by this handler
    • supports

      boolean supports(FailureBatch failureBatch)
      Guides the main failure handling service, when deciding whether this handler is suitable for a certain batch of failures
      Parameters:
      failureBatch - a batch of failures to test
      Returns:
      true if the batch can be processed by this handler
    • isEnabled

      boolean isEnabled()
      Guides the main failure handling service, when deciding whether this handler is available for processing.
      Returns:
      true if this handler can accept failure batches