public class QueueMessagingTemplate extends AbstractMessageChannelMessagingSendingTemplate<QueueMessageChannel> implements DestinationResolvingMessageReceivingOperations<QueueMessageChannel>
StringMessageConverter
as it fits the underlying message channel type. If a
message converter is set through the constructor then it is added to a composite
converter already containing the StringMessageConverter
. If
AbstractMessageSendingTemplate.setMessageConverter(MessageConverter)
is used, then the
CompositeMessageConverter
containing the StringMessageConverter
will
not be used anymore and the String
payloads are also going to be converted with
the set converter.CONVERSION_HINT_HEADER, logger
Constructor and Description |
---|
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs) |
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs,
DestinationResolver<String> destinationResolver,
MessageConverter messageConverter)
Initializes the messaging template by configuring the destination resolver as well
as the message converter.
|
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs,
DestinationResolver<String> destinationResolver,
MessageConverter messageConverter,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs,
ResourceIdResolver resourceIdResolver) |
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs,
ResourceIdResolver resourceIdResolver,
MessageConverter messageConverter)
Initializes the messaging template by configuring the resource Id resolver as well
as the message converter.
|
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs,
ResourceIdResolver resourceIdResolver,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
Modifier and Type | Method and Description |
---|---|
Message<?> |
receive() |
Message<?> |
receive(QueueMessageChannel destination) |
Message<?> |
receive(String destinationName) |
<T> T |
receiveAndConvert(Class<T> targetClass) |
<T> T |
receiveAndConvert(QueueMessageChannel destination,
Class<T> targetClass) |
<T> T |
receiveAndConvert(String destinationName,
Class<T> targetClass) |
protected QueueMessageChannel |
resolveMessageChannel(String physicalResourceIdentifier) |
convertAndSend, convertAndSend, convertAndSend, convertAndSend, doSend, initMessageConverter, initMessageConverter, resolveMessageChannelByLogicalName, send, setDefaultDestinationName
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, send
public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs)
public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs, ResourceIdResolver resourceIdResolver)
public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs, ResourceIdResolver resourceIdResolver, MessageConverter messageConverter)
DynamicQueueUrlDestinationResolver
with
the default configuration to resolve destination names.amazonSqs
- The AmazonSQS
client, cannot be null
.resourceIdResolver
- The ResourceIdResolver
to be used for resolving
logical queue names.messageConverter
- A MessageConverter
that is going to be added to the
composite converter.public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs, ResourceIdResolver resourceIdResolver, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs, DestinationResolver<String> destinationResolver, MessageConverter messageConverter)
DynamicQueueUrlDestinationResolver
with
the default configuration to resolve destination names.amazonSqs
- The AmazonSQS
client, cannot be null
.destinationResolver
- A destination resolver implementation to resolve queue
names into queue urls. The destination resolver will be wrapped into a
CachingDestinationResolverProxy
to avoid
duplicate queue url resolutions.messageConverter
- A MessageConverter
that is going to be added to the
composite converter.public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs, DestinationResolver<String> destinationResolver, MessageConverter messageConverter, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
protected QueueMessageChannel resolveMessageChannel(String physicalResourceIdentifier)
resolveMessageChannel
in class AbstractMessageChannelMessagingSendingTemplate<QueueMessageChannel>
public Message<?> receive() throws MessagingException
receive
in interface MessageReceivingOperations<QueueMessageChannel>
MessagingException
public Message<?> receive(QueueMessageChannel destination) throws MessagingException
receive
in interface MessageReceivingOperations<QueueMessageChannel>
MessagingException
public <T> T receiveAndConvert(Class<T> targetClass) throws MessagingException
receiveAndConvert
in interface MessageReceivingOperations<QueueMessageChannel>
MessagingException
public <T> T receiveAndConvert(QueueMessageChannel destination, Class<T> targetClass) throws MessagingException
receiveAndConvert
in interface MessageReceivingOperations<QueueMessageChannel>
MessagingException
public Message<?> receive(String destinationName) throws MessagingException
receive
in interface DestinationResolvingMessageReceivingOperations<QueueMessageChannel>
MessagingException
public <T> T receiveAndConvert(String destinationName, Class<T> targetClass) throws MessagingException
receiveAndConvert
in interface DestinationResolvingMessageReceivingOperations<QueueMessageChannel>
MessagingException
Copyright © 2022 Pivotal Software, Inc.. All rights reserved.