Package io.awspring.cloud.sqs.operations
Interface MessagingOperations
- All Known Subinterfaces:
SqsOperations
- All Known Implementing Classes:
AbstractMessagingTemplate
,SqsTemplate
public interface MessagingOperations
Synchronous messaging operations. Implementations should have defaults for
Nullable
fields, and can provide
chained methods interfaces to provide a more fluent API.- Since:
- 3.0
- Author:
- Tomaz Fernandes
-
Method Summary
Modifier and TypeMethodDescriptionreceive()
Receive a message from the default queue with default settings.Receive a message from the provided queue and convert the payload to the provided class.Collection<Message<?>>
Receive a batch of messages from the default queue with default settings.<T> Collection<Message<T>>
receiveMany
(String queue, Class<T> payloadClass) Receive a batch of messages from the provided queue and convert the payloads to the provided class.<T> SendResult<T>
Send the provided message along with its headers to the provided queue.<T> SendResult<T>
Send a message to the provided queue with the provided payload.<T> SendResult<T>
send
(T payload) Send aMessage
to the default queue with the provided payload.<T> SendResult.Batch<T>
sendMany
(String queue, Collection<Message<T>> messages) Send the provided messages along with their headers to the provided queue.
-
Method Details
-
send
Send aMessage
to the default queue with the provided payload. The payload will be serialized if necessary.- Parameters:
payload
- the payload to send.- Returns:
- The message's
UUID
.
-
send
Send a message to the provided queue with the provided payload. The payload will be serialized if necessary.- Parameters:
queue
- the queue to send the message to.payload
- the payload to send.- Returns:
- The message's
UUID
.
-
send
Send the provided message along with its headers to the provided queue. The payload will be serialized if necessary, and headers will be converted to the specific messaging system metadata types.- Parameters:
queue
- the queue to send the message to.message
- the message to be sent.- Returns:
- The message's
UUID
.
-
sendMany
Send the provided messages along with their headers to the provided queue. The payloads will be serialized if necessary, and headers will be converted to the specific messaging system metadata types.- Parameters:
queue
- the queue to send the messages to.messages
- the messages to be sent.- Returns:
- The message's
UUID
.
-
receive
Receive a message from the default queue with default settings.- Returns:
- the message or
Optional.empty()
if none is returned.
-
receive
Receive a message from the provided queue and convert the payload to the provided class. If no message is returned after the defaultDuration
, anOptional.empty()
is returned.- Parameters:
queue
- the queue from which to receive the messages.payloadClass
- the class to which the payload should be converted to.- Returns:
- the message or
Optional.empty()
if none is returned.
-
receiveMany
Collection<Message<?>> receiveMany()Receive a batch of messages from the default queue with default settings.- Returns:
- The messages, or an empty collection if none is returned.
-
receiveMany
Receive a batch of messages from the provided queue and convert the payloads to the provided class. If no message is returned after the defaultDuration
, an empty collection is returned.- Parameters:
queue
- the queue from which to receive the messages.payloadClass
- the class to which the payloads should be converted to.- Returns:
- The messages, or an empty collection if none is returned.
-