Class KinesisEventHandler
java.lang.Object
io.quarkus.funqy.lambda.event.kinesis.KinesisEventHandler
- All Implemented Interfaces:
EventHandler<com.amazonaws.services.lambda.runtime.events.KinesisEvent,com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record, com.amazonaws.services.lambda.runtime.events.StreamsEventResponse>
public class KinesisEventHandler
extends Object
implements EventHandler<com.amazonaws.services.lambda.runtime.events.KinesisEvent,com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record,com.amazonaws.services.lambda.runtime.events.StreamsEventResponse>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.amazonaws.services.lambda.runtime.events.StreamsEventResponsecreateResponse(List<String> failures, FunqyAmazonConfig amazonConfig) Create the response based on the collected failures.getBody(com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record message, FunqyAmazonConfig amazonConfig) Get the body of a message as anInputStreamgetIdentifier(com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record message, FunqyAmazonConfig amazonConfig) Get the identifier of a message.Class<com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record>The class of the messageStream<com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record>streamEvent(com.amazonaws.services.lambda.runtime.events.KinesisEvent event, FunqyAmazonConfig amazonConfig) Provides all messages from the event.
-
Constructor Details
-
KinesisEventHandler
public KinesisEventHandler()
-
-
Method Details
-
streamEvent
public Stream<com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record> streamEvent(com.amazonaws.services.lambda.runtime.events.KinesisEvent event, FunqyAmazonConfig amazonConfig) Description copied from interface:EventHandlerProvides all messages from the event. Specially for events with multiple messages from a batch.- Specified by:
streamEventin interfaceEventHandler<com.amazonaws.services.lambda.runtime.events.KinesisEvent,com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record, com.amazonaws.services.lambda.runtime.events.StreamsEventResponse> - Parameters:
event- event to provide messages fromamazonConfig- config- Returns:
- a stream of messages
-
getIdentifier
public String getIdentifier(com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record message, FunqyAmazonConfig amazonConfig) Description copied from interface:EventHandlerGet the identifier of a message.- Specified by:
getIdentifierin interfaceEventHandler<com.amazonaws.services.lambda.runtime.events.KinesisEvent,com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record, com.amazonaws.services.lambda.runtime.events.StreamsEventResponse> - Parameters:
message- message to extract the identifier fromamazonConfig- config- Returns:
- the identifier
-
getBody
public Supplier<InputStream> getBody(com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record message, FunqyAmazonConfig amazonConfig) Description copied from interface:EventHandlerGet the body of a message as anInputStream- Specified by:
getBodyin interfaceEventHandler<com.amazonaws.services.lambda.runtime.events.KinesisEvent,com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record, com.amazonaws.services.lambda.runtime.events.StreamsEventResponse> - Parameters:
message- message to extract the body fromamazonConfig- config- Returns:
- the body input stream
-
createResponse
public com.amazonaws.services.lambda.runtime.events.StreamsEventResponse createResponse(List<String> failures, FunqyAmazonConfig amazonConfig) Description copied from interface:EventHandlerCreate the response based on the collected failures.- Specified by:
createResponsein interfaceEventHandler<com.amazonaws.services.lambda.runtime.events.KinesisEvent,com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record, com.amazonaws.services.lambda.runtime.events.StreamsEventResponse> - Parameters:
failures- a list of message identifier, which failedamazonConfig- config- Returns:
- the created response
-
getMessageClass
Description copied from interface:EventHandlerThe class of the message- Specified by:
getMessageClassin interfaceEventHandler<com.amazonaws.services.lambda.runtime.events.KinesisEvent,com.amazonaws.services.lambda.runtime.events.KinesisEvent.Record, com.amazonaws.services.lambda.runtime.events.StreamsEventResponse> - Returns:
- the class of the message
-