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

Consumer Retry Mechanism ? #274

Open
jason810496 opened this issue Jul 1, 2024 · 5 comments
Open

Consumer Retry Mechanism ? #274

jason810496 opened this issue Jul 1, 2024 · 5 comments
Labels
question Further information is requested

Comments

@jason810496
Copy link
Contributor

Hi,

I am currently using pgmq as an alternative to RabbitMQ.
I'm wondering if the current project supports a retry mechanism (like x-retry-count in RabbitMQ), or if I need to create another table to record the retry count to implement it.

I have read the documentation about Set the visibility timeout (VT) for a specific message,
but I prefer a scenario where the message is archived after being retried X times.

Thank you for your help!

@ChuckHend
Copy link
Contributor

Hi @jason810496, thanks for asking!

Each message has a field read_ct that increments every time the message is read with pgmg.read()

select * from pgmq.read(queue_name => 'myqueue', vt => 10, qty => 1);
 msg_id | read_ct |          enqueued_at          |              vt               |      message       
--------+---------+-------------------------------+-------------------------------+--------------------
      1 |       1 | 2024-07-01 12:39:02.198732+00 | 2024-07-01 12:39:28.176894+00 | {"hello": "world"}

There isn't a mechanism that will automatically move the message to another queue (like a DLQ or something). But what some projects do is have their consumer check the read_ct value then move/archive/delete the message if it exceeds some value.

@v0idpwn
Copy link
Collaborator

v0idpwn commented Jul 1, 2024

@jason810496
Copy link
Contributor Author

Thanks for the reply, @ChuckHend 🙏
I will use read_ct to mark the message as failed to process.

@jason810496
Copy link
Contributor Author

Hi, @v0idpwn
Do you have any description on how to use the project? Thanks.

@ChuckHend ChuckHend added the question Further information is requested label Jul 3, 2024
@v0idpwn
Copy link
Collaborator

v0idpwn commented Jul 4, 2024

@jason810496 there's some info in the documentation and on broadway documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants