I’m looking for a design architecture to synchronize stopping SQS consumption across all ECS tasks when a process is running and start them at the end of process
I initially considered a design that involves publishing a message to an SNS topic, with all the tasks subscribing to this topic. However, this approach doesn’t work at all, because when the first task consumes the message, the other tasks can’t consume it (because it’s already consumed).
In my current solution, I store the states of the ECS tasks in an RDS table to track whether they are consuming SQS messages or not (I’m using MessageListenerContainerRegistry, which works pretty well).
Does anyone have ideas for a better solution? Or a totally different design? I want to avoid polling the RDS for a table that tracks the state of SQS consumption.
Thanks!