Class PipesSqsEventHandler
java.lang.Object
io.quarkus.funqy.lambda.event.sqs.PipesSqsEventHandler
- All Implemented Interfaces:
EventHandler<List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>,com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage, Response>
public class PipesSqsEventHandler
extends Object
implements EventHandler<List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>,com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage,Response>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateResponse(List<String> failures, FunqyAmazonConfig amazonConfig) Create the response based on the collected failures.getBody(com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage message, FunqyAmazonConfig amazonConfig) Get the body of a message as anInputStreamgetIdentifier(com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage message, FunqyAmazonConfig amazonConfig) Get the identifier of a message.Class<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>The class of the messageStream<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>streamEvent(List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage> event, FunqyAmazonConfig amazonConfig) Provides all messages from the event.
-
Constructor Details
-
PipesSqsEventHandler
public PipesSqsEventHandler()
-
-
Method Details
-
streamEvent
public Stream<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage> streamEvent(List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage> 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<List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>,com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage, Response> - Parameters:
event- event to provide messages fromamazonConfig- config- Returns:
- a stream of messages
-
getIdentifier
public String getIdentifier(com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage message, FunqyAmazonConfig amazonConfig) Description copied from interface:EventHandlerGet the identifier of a message.- Specified by:
getIdentifierin interfaceEventHandler<List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>,com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage, Response> - Parameters:
message- message to extract the identifier fromamazonConfig- config- Returns:
- the identifier
-
getBody
public Supplier<InputStream> getBody(com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage message, FunqyAmazonConfig amazonConfig) Description copied from interface:EventHandlerGet the body of a message as anInputStream- Specified by:
getBodyin interfaceEventHandler<List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>,com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage, Response> - Parameters:
message- message to extract the body fromamazonConfig- config- Returns:
- the body input stream
-
createResponse
Description copied from interface:EventHandlerCreate the response based on the collected failures.- Specified by:
createResponsein interfaceEventHandler<List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>,com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage, Response> - 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<List<com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage>,com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage, Response> - Returns:
- the class of the message
-