Class MessageGroupingSinkAdapter<T>
java.lang.Object
io.awspring.cloud.sqs.listener.sink.adapter.AbstractDelegatingMessageListeningSinkAdapter<T>
io.awspring.cloud.sqs.listener.sink.adapter.MessageGroupingSinkAdapter<T>
- All Implemented Interfaces:
ConfigurableContainerComponent,MessageProcessingPipelineSink<T>,MessageSink<T>,SqsAsyncClientAware,TaskExecutorAware,Lifecycle,Phased,SmartLifecycle
AbstractDelegatingMessageListeningSinkAdapter implementation that groups the received batch according to the
provided grouping function and emits each sub batch to the delegate separately.- Since:
- 3.0
- Author:
- Tomaz Fernandes
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionMessageGroupingSinkAdapter(MessageSink<T> delegate, Function<Message<T>, String> groupingFunction) -
Method Summary
Modifier and TypeMethodDescriptionemit(Collection<Message<T>> messages, MessageProcessingContext<T> context) Emit the providedMessageinstances to the providedAsyncMessageListener.Methods inherited from class io.awspring.cloud.sqs.listener.sink.adapter.AbstractDelegatingMessageListeningSinkAdapter
configure, getDelegate, isRunning, setMessagePipeline, setSqsAsyncClient, setTaskExecutor, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isAutoStartup, stop
-
Constructor Details
-
MessageGroupingSinkAdapter
-
-
Method Details
-
emit
public CompletableFuture<Void> emit(Collection<Message<T>> messages, MessageProcessingContext<T> context) Description copied from interface:MessageSinkEmit the providedMessageinstances to the providedAsyncMessageListener.- Parameters:
messages- the messages to emit.- Returns:
- a collection of
CompletableFutureinstances, each representing the completion signal of a single message processing.
-