Package io.quarkus.funqy.lambda.event
Interface EventHandler<E,M,R>
- Type Parameters:
E- type of the eventM- type of the messageR- 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 Summary
Modifier and TypeMethodDescriptioncreateResponse(List<String> failures, FunqyAmazonConfig amazonConfig) Create the response based on the collected failures.getBody(M message, FunqyAmazonConfig amazonConfig) Get the body of a message as anInputStreamgetIdentifier(M message, FunqyAmazonConfig amazonConfig) Get the identifier of a message.The class of the messagestreamEvent(E event, FunqyAmazonConfig amazonConfig) Provides all messages from the event.
-
Method Details
-
streamEvent
Provides all messages from the event. Specially for events with multiple messages from a batch.- Parameters:
event- event to provide messages fromamazonConfig- config- Returns:
- a stream of messages
-
getIdentifier
Get the identifier of a message.- Parameters:
message- message to extract the identifier fromamazonConfig- config- Returns:
- the identifier
-
getBody
Get the body of a message as anInputStream- Parameters:
message- message to extract the body fromamazonConfig- config- Returns:
- the body input stream
-
createResponse
Create the response based on the collected failures.- Parameters:
failures- a list of message identifier, which failedamazonConfig- config- Returns:
- the created response
-
getMessageClass
The class of the message- Returns:
- the class of the message
-