Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine and implement a way to mark messages that need to be retried as well as retrying them (could be another queue in RabbitMQ or could be a DB table) #34

Open
jgrim opened this issue Jan 20, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@jgrim
Copy link
Member

jgrim commented Jan 20, 2024

No description provided.

@jgrim jgrim converted this from a draft issue Jan 20, 2024
@jgrim jgrim added the enhancement New feature or request label Jan 20, 2024
@devanbenz devanbenz moved this from 📋 Backlog to 🔖 Ready in Sublinks Federation Jan 20, 2024
@devanbenz devanbenz moved this from 🔖 Ready to 📋 Backlog in Sublinks Federation Jan 20, 2024
@devanbenz
Copy link
Member

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.

@lazyguru
Copy link
Member

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.

@devanbenz
Copy link
Member

@lazyguru good point that makes sense. I'm thinking we have two options here:

  1. We implement a "delay queue" that has messages with a TTL on them so there is an exponential back-off and we consume them like normal messages https://blog.rabbitmq.com/posts/2015/04/scheduling-messages-with-rabbitmq/
  2. Have an in-application delay for messages. The caveat for this is that the function processing this message will be blocked while still working on it. (I think)

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.

@lazyguru
Copy link
Member

lazyguru commented Jan 23, 2024

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.

@devanbenz devanbenz moved this from 📋 Backlog to 🔖 Ready in Sublinks Federation Apr 30, 2024
@lazyguru lazyguru added this to the Version 0.1 Alpha milestone Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🔖 Ready
Development

No branches or pull requests

3 participants