Interface EventHandler<E,M,R>

Type Parameters:
E - type of the event
M - type of the message
R - type of the response
All Known Implementing Classes:
CloudEventsHandler, DynamoDbEventHandler, KinesisEventHandler, PipesDynamoDbEventHandler, PipesKinesisEventHandler, PipesSqsEventHandler, SnsEventHandler, SqsEventHandler

public interface EventHandler<E,M,R>
This interface described how events should be handled
  • Method Details

    • streamEvent

      Stream<M> streamEvent(E event, FunqyAmazonConfig amazonConfig)
      Provides all messages from the event. Specially for events with multiple messages from a batch.
      Parameters:
      event - event to provide messages from
      amazonConfig - config
      Returns:
      a stream of messages
    • getIdentifier

      String getIdentifier(M message, FunqyAmazonConfig amazonConfig)
      Get the identifier of a message.
      Parameters:
      message - message to extract the identifier from
      amazonConfig - config
      Returns:
      the identifier
    • getBody

      Supplier<InputStream> getBody(M message, FunqyAmazonConfig amazonConfig)
      Get the body of a message as an InputStream
      Parameters:
      message - message to extract the body from
      amazonConfig - config
      Returns:
      the body input stream
    • createResponse

      R createResponse(List<String> failures, FunqyAmazonConfig amazonConfig)
      Create the response based on the collected failures.
      Parameters:
      failures - a list of message identifier, which failed
      amazonConfig - config
      Returns:
      the created response
    • getMessageClass

      Class<M> getMessageClass()
      The class of the message
      Returns:
      the class of the message