Skip to content
Advertisement

AWS SQS only receiving 1 message from two different dispatch

Currently, I’m using the AWS PHP SDK to communicate with AWS SQS. I’m using a FIFO queue.

We have different “models” that need to communicate with SQS, therefore they all have different message group ids in order to make SQS more efficient in processing the data.

I’ve made a method that dispatches calls to AWS SQS called DispatchSQSJob($arrayData, $messageGroupId = ‘default’)

I’m currently looping over an array of contacts, and for each contact, I call DispatchSQSJob with the contact’s data and a specific messageGroupId, IE: “contact”

Unfortunately, it seems that the moment that my contacts array’s size is higher than 1, SQS only receives 1 of the messages instead of the amount of contacts there is in the array.

If anyone has any idea why this could be the issue, I’d love to know. Thank you

Advertisement

Answer

Turns out, I didn’t have Content-based deduplication and Enable high throughput FIFO enabled. I also still had the MessageDeduplicationId being sent by my method.

Having those options enabled and removing the MessageDeduplicationId I sent fixed it.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement