public class QueueMessagingTemplate extends AbstractMessageChannelMessagingSendingTemplate<QueueMessageChannel> implements org.springframework.messaging.core.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.Constructor and Description |
---|
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs) |
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs,
org.springframework.messaging.core.DestinationResolver<String> destinationResolver,
org.springframework.messaging.converter.MessageConverter messageConverter)
Initializes the messaging template by configuring the destination resolver as well
as the message converter.
|
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs,
org.springframework.cloud.aws.core.env.ResourceIdResolver resourceIdResolver) |
QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs,
org.springframework.cloud.aws.core.env.ResourceIdResolver resourceIdResolver,
org.springframework.messaging.converter.MessageConverter messageConverter)
Initializes the messaging template by configuring the resource Id resolver as well
as the message converter.
|
Modifier and Type | Method and Description |
---|---|
org.springframework.messaging.Message<?> |
receive() |
org.springframework.messaging.Message<?> |
receive(QueueMessageChannel destination) |
org.springframework.messaging.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, resolveMessageChannelByLogicalName, send, setDefaultDestinationName
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverter
public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs)
public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs, org.springframework.cloud.aws.core.env.ResourceIdResolver resourceIdResolver)
public QueueMessagingTemplate(com.amazonaws.services.sqs.AmazonSQSAsync amazonSqs, org.springframework.cloud.aws.core.env.ResourceIdResolver resourceIdResolver, org.springframework.messaging.converter.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, org.springframework.messaging.core.DestinationResolver<String> destinationResolver, org.springframework.messaging.converter.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.protected QueueMessageChannel resolveMessageChannel(String physicalResourceIdentifier)
resolveMessageChannel
in class AbstractMessageChannelMessagingSendingTemplate<QueueMessageChannel>
public org.springframework.messaging.Message<?> receive() throws org.springframework.messaging.MessagingException
receive
in interface org.springframework.messaging.core.MessageReceivingOperations<QueueMessageChannel>
org.springframework.messaging.MessagingException
public org.springframework.messaging.Message<?> receive(QueueMessageChannel destination) throws org.springframework.messaging.MessagingException
receive
in interface org.springframework.messaging.core.MessageReceivingOperations<QueueMessageChannel>
org.springframework.messaging.MessagingException
public <T> T receiveAndConvert(Class<T> targetClass) throws org.springframework.messaging.MessagingException
receiveAndConvert
in interface org.springframework.messaging.core.MessageReceivingOperations<QueueMessageChannel>
org.springframework.messaging.MessagingException
public <T> T receiveAndConvert(QueueMessageChannel destination, Class<T> targetClass) throws org.springframework.messaging.MessagingException
receiveAndConvert
in interface org.springframework.messaging.core.MessageReceivingOperations<QueueMessageChannel>
org.springframework.messaging.MessagingException
public org.springframework.messaging.Message<?> receive(String destinationName) throws org.springframework.messaging.MessagingException
receive
in interface org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations<QueueMessageChannel>
org.springframework.messaging.MessagingException
public <T> T receiveAndConvert(String destinationName, Class<T> targetClass) throws org.springframework.messaging.MessagingException
receiveAndConvert
in interface org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations<QueueMessageChannel>
org.springframework.messaging.MessagingException
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.