Open jgrim opened 10 months ago
The thing to keep in mind is that the messages that need to be retried could be for different servers. Some of those will succeed on retry as they were only temporarily unavailable. However, some will fail again and need to be retried multiple times. We will want to support exponential back off in our retries.
@lazyguru good point that makes sense. I'm thinking we have two options here:
If we were to implement the delayed queue and a dead letter queue it may contain all this logic in a single area (rabbitmq) which would be pretty nice.
We already have to store the messages in a DB table to make them immutable and available via http requests. We can K.I.S.S in the beginning and just have a table to track what the last message_id was sent to which server (like Lemmy does). Having a DLQ won't work because a message might be successfully sent to serverA but not serverB or serverC on first attempt. Then later serverB comes back online and is reachable, but serverC never returns.
https://www.rabbitmq.com/dlx.html Could probably use a dead letter queue for this. In other services that utilize a queue system I've always used SQS so I'm not super familiar with RabbitMQ but in SQS we generally have a dead letter queue for dead message processing.