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 Details

    • sendBatch

      <T> BatchResult sendBatch(String topicName, Collection<Message<T>> messages)
      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 topic
      messages - Collection of Spring messages to send
      Returns:
      BatchResult containing successful results and errors if there are any
    • convertAndSend

      <T> BatchResult convertAndSend(String topicName, Collection<T> payloads)
      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 topic
      payloads - 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 topic
      notifications - Collection of SnsNotification to convert and send
      Returns:
      BatchResult containing successful results and errors if there are any