I have three SQS FIFO queues where each one has a data projection listener daemon in EC2 instance as docker pods (SQL Server, PostgreSQL, Elastic Search, etc.)
All queues have the same settings as below (Dead-Letter Queues to setup later).
Queue Type: FIFO
Messages Delayed: 0
Content-Based Deduplication: Enabled
Default Visibility Timeout: 30 seconds
Message Retention Period: 14 days
Maximum Message Size: 256 KB
This is all part of an Event Sourcing architecture I am designing using DynamoDB Stream => Lambda SQS Router => SQS FIFO Queues (due to SNS not supporting FIFO queues as subscribers)
Content-Based Deduplication
is enabled to avoid duplicate messages in the queue since an error is always possible in the Lambda Router for any of the queues.
Now, I also have set the MessageGroupId
for each message to the AggregateId to group them but don't really understand how that is utilized by the consumer side;
I have only one consumer per SQS queue at the moment but what if I want to scale consumers. Is an application concern to make sure multiple consumers will not process messages from the same MessageGroupId; - which is unacceptable since using FIFO queues is due to order retention of events in the system!