Amazon SQS FIFO Queue send message validation

0 votes

I am working on using amazon's fifo queue and when I send a message I would like to know if the item was added with my call, or if the message was already in the queue and it just returned true

Sep 7, 2018 in AWS by bug_seeker
• 15,350 points
158 views

1 answer to this question.

0 votes

Assuming you only have one process adding messages to the queue, just keep track of the sequenceNumber from the result (ie: add it to a Set) - once you have X unique sequenceNumbers, you're set (no pun intended).

If you have multiple processes adding messages, you'll need to either

  1. ensure the messages sent by each process are unique (and thus can use the same mechanism as single process), or
  2. use some mechanism of sharing information between processes
    • doing this option properly is likely more expensive than it's worth, and I'd strongly suggest either designing for option 1, or revisiting the requirement that each process sends exactly X unique messages, especially if "approximately X" is good enough.
answered Sep 7, 2018 by Priyaj
• 56,900 points

Related Questions In AWS

0 votes
1 answer

Polling the queue in Amazon SQS

One way is you could create a ...READ MORE

answered Dec 20, 2018 in AWS by Archana
• 5,560 points
62 views
0 votes
1 answer

How to enable Amazon Simple Queue Service (SQS)

Please follow the below steps in order ...READ MORE

answered Dec 28, 2018 in AWS by Shuvodip
86 views
+1 vote
5 answers

Can Celery be used with Amazon SQS

I regenerated the credentials in the IAM ...READ MORE

answered Oct 25, 2018 in AWS by triedntested
453 views
0 votes
1 answer

What is the difference between Amazon SNS and Amazon SQS?

SNS is a distributed publish-subscribe system and the messages are pushed to ...READ MORE

answered Jul 30, 2018 in AWS by Mrunal
• 680 points
684 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I roll-back a message to Amazon MQ (AMQ) from Lambda?

It is apparently not possible using STOMP ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,900 points
167 views