Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending multiple messages to SNS on a single call

I have a scenario where every time lambda runs, it will send 1000 messages to a SNS topic. I can loop through the list of messages and call the publish method 1000 times, one message at a time but I was wondering if there is a way to send multiple messages in one call. In that case I can batch the messages and call publish let say 10 with 100 messages on each execution.

I would really appreciate if someone can help on this.

like image 592
DoArNa Avatar asked Oct 26 '25 02:10

DoArNa


1 Answers

SNS has just introduced the PublishBatch API, which you can use to send up to 10 messages to an SNS topic in a single API request. More information on the feature launch can be found here: https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-sns-supports-publishing-batches-messages-single-api-request/

like image 139
Otavio Ferreira Avatar answered Oct 27 '25 19:10

Otavio Ferreira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!