Class AbstractMessageConvertingMessageSource<T,S>
java.lang.Object
io.awspring.cloud.sqs.listener.source.AbstractMessageConvertingMessageSource<T,S>
- All Implemented Interfaces:
ConfigurableContainerComponent,MessageSource<T>
- Direct Known Subclasses:
AbstractPollingMessageSource
public abstract class AbstractMessageConvertingMessageSource<T,S>
extends Object
implements MessageSource<T>
A
MessageSource implementation capable of converting messages from a Source type to a Target type. Subclasses
can use the convertMessage(S) or convertMessages(java.util.Collection<S>) methods to perform the conversion.
The MessagingMessageConverter can be retrieved from the ContainerOptions or from a subclass.
For converters that implement ContextAwareMessagingMessageConverter, a MessageConversionContext will
be created, which can contain more useful information for message conversion.
If such context implements the AcknowledgementAwareMessageConversionContext, an
AcknowledgementCallback can be added to the context by using the setupAcknowledgementForConversion(io.awspring.cloud.sqs.listener.acknowledgement.AcknowledgementCallback<T>)
method/.
- Since:
- 3.0
- Author:
- Tomaz Fernandes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(ContainerOptions<?, ?> containerOptions) Configure the component with the providedContainerOptionsinstanceprotected voidconfigureMessageSource(ContainerOptions<?, ?> containerOptions) convertMessage(S msg) protected Collection<Message<T>>convertMessages(Collection<S> messages) protected MessageConversionContextprotected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.awspring.cloud.sqs.listener.source.MessageSource
setMessageSink
-
Constructor Details
-
AbstractMessageConvertingMessageSource
public AbstractMessageConvertingMessageSource()
-
-
Method Details
-
configure
Description copied from interface:ConfigurableContainerComponentConfigure the component with the providedContainerOptionsinstance- Specified by:
configurein interfaceConfigurableContainerComponent
-
configureMessageSource
-
setupAcknowledgementForConversion
-
convertMessages
-
convertMessage
-
getMessageConversionContext
-