Interface SnsBatchOperations
- All Known Implementing Classes:
SnsBatchTemplate
public interface SnsBatchOperations
Provides methods for sending multiple messages to SNS topics in a single batch operation, which is more efficient
than sending messages individually.
- Since:
- 4.1.0
- Author:
- Matej Nedic
-
Method Summary
Modifier and TypeMethodDescription<T> BatchResultconvertAndSend(String topicName, Collection<T> payloads) Converts a collection of POJOs to Spring messages and sends them as a batch to the specified SNS topic.<T> BatchResultsendBatch(String topicName, Collection<Message<T>> messages) Sends a batch of messages to the specified SNS topic.<T> BatchResultsendBatchNotifications(String topicName, Collection<SnsNotification<T>> notifications) Converts a collection of notifications to Spring messages and sends them as a batch to the specified SNS topic.
-
Method Details
-
sendBatch
Sends a batch of messages to the specified SNS topic. Due AWS SNS Batch Api limit. It will split messages in groups of 10. The result contains information about both successful and failed messages.- Type Parameters:
T- The type of the message payload- Parameters:
topicName- The logical name of the SNS topicmessages- Collection of Spring messages to send- Returns:
- BatchResult containing successful results and errors if there are any
-
convertAndSend
Converts a collection of POJOs to Spring messages and sends them as a batch to the specified SNS topic. Batch API limit, messages will be split into groups of 10.The result contains information about both successful and failed messages.
- Type Parameters:
T- The type of the payload- Parameters:
topicName- The logical name of the SNS topicpayloads- Collection of payloads to convert and send- Returns:
- BatchResult containing successful results and errors if there are any
-
sendBatchNotifications
<T> BatchResult sendBatchNotifications(String topicName, Collection<SnsNotification<T>> notifications) Converts a collection of notifications to Spring messages and sends them as a batch to the specified SNS topic. Batch API limit, messages will be split into groups of 10.The result contains information about both successful and failed messages.
- Type Parameters:
T- The type of the payload- Parameters:
topicName- The logical name of the SNS topicnotifications- Collection ofSnsNotificationto convert and send- Returns:
- BatchResult containing successful results and errors if there are any
-