Skip to content

Discussion/feature request - configurable queue deduplication semantics #53

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

Open
pbillen opened this issue Feb 9, 2020 · 1 comment

Comments

@pbillen
Copy link

pbillen commented Feb 9, 2020

Hi,

I would like to discuss something regarding queue deduplication semantics, in the hope to get some interest for extending this plugin.

One could define two definitions for queue deduplication:

  1. do not enqueue a message if an equivalent message is already present in the queue
  2. do not enqueue a message if an equivalent message is already present and not being processed in the queue

From my understanding in #51, this plugin currently implements the first definition, being the most intuitive and safe/correct definition.

For the project I am working on, it would be useful if we could support the second definition as well. (Please let me know if you want me to elaborate on this. In short, I am using RabbitMQ to notify workers that tasks have been added to the database, available to be executed. Here, it is only safe to prevent duplicates under the second definition, as we cannot know for sure that an ongoing consumer will see all additional tasks being added during its execution loop.)

Is this something that could be implemented in this plugin? We could define the deduplication definition to be applied via some argument property when creating the queue?

Note: It's important to document that we can end up with "real" duplicates in the queue. For example, assume we are preventing duplicates under the second definition. Assume a certain consumer, with manual acknowledgement enabled, is processing message X while we enqueue another message X. Under the second definition, this is allowed. If now the consumer crashes or rejects message X, it is given back to the queue. At this point, we have two X messages.

Thank you.

@pbillen
Copy link
Author

pbillen commented Feb 9, 2020

After reading #27, I believe this is a duplicate (no pun intented) of that issue.

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

No branches or pull requests

1 participant