-
Notifications
You must be signed in to change notification settings - Fork 537
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
Strict ordering for jobs #179
Comments
Message Groups in ActiveMQ exemplify this use case perfectly. |
Have M1.x create Mz.x1 before its done. Envoyé de mon iPad
|
That won't work. Lets say we have 3 consumers C1, C2, C3 and the messages are pushed in the order M1, M2, Mz, M3, ... In this case C1 will pickup M1, C2 will pickup M2 and C3 will pick up Mz thus violating the requirement that Mz be processed exclusively after M1 |
It seems Mz depends on M1. When C1 picks up M1, after it's done, it creates On Wed, Mar 16, 2016 at 8:28 AM Amit Prakash Ambasta <
|
No. M1 and Mz have been created by a producer in a strict order, not by the consumer. What I am trying to request (as a feature if unsupported) is the ability to ensure ordered delivery of messages based on some message parameter, a functionality identical to Message Groups in ActiveMQ |
Hello, in general you can force ordering in a not-ordered queue, if you have some way to keep state during job processing. So imagine M1, M2, M3, and you want the messages to be processed into this strict order 1, 2, 3.
Each message also has a The So what happens is that the messages, when operating to some resource, set the previous state in the data store used. Even if the messages will arrive not ordered, the state field of the store (assuming it's a consistent state), will force the message to be executed in the right order. If M2 arrives before M1, it will be discarded, later M1 will arrive or be scheduled again and retransmitted, and eventually it will be processed. Now M2 can be executed. And so forth... I hope this solves your problem. There are no plans to add something built-in for in order processing into Disque at the moment. There are already too many queues attempting to do that, and the design sacrifice leading to this feature to be removed is the same that opens so many possibilities for Disque, in my opinion. |
Hey antirez, Thanks for the response. While I understand the approach you've outlined above, this won't work for a distributed producer or multiple producers. I understand the challenges and limitations of such an approach however. Thanks for the reply |
Hi,
Consider messages M1, M2, ... Mn, with each message having a feature x such that M1.x = x1, M2.x = x2, ..., Mn.x = xn..
Now consider another message Mz where Mz.x = x1
Given say, p consumers waiting for jobs, is it possible to enforce that Mz is strictly processed only after M1 has been processsed. Meanwhile M1, M2, ..., Mn can be processed in any order
The text was updated successfully, but these errors were encountered: