-
Notifications
You must be signed in to change notification settings - Fork 20
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
Multi channel selecting queue for worker prioritization #34
Comments
The priorities of the messages should not be handled by your node client but instead by the AMQP server, which has the queue and should reorder your messages before they hit the worker. The spec says that AMQP servers MUST implement 2 priorities:
However, RabbitMQ does not support priorities at all, which I assume you are using. See this list of compliance. I would suggest using the plugin for priority queues to add this support. Priorities cannot be defined for channels. Channels should be used instead to separate each worker. The master would open the connection and each worker would open a channel. |
I'll take a close look at the plugin, it seems it may do what I need. If The idea behind having multiple channels within a connection was as Are there any examples on using multiple channels anyway? I know from I assume you currently see channels as a way to support the interaction On 1/8/2015 2:34 PM, Grant Bakker wrote:
|
None yet. I have been planning some advanced tutorials and this will be part of it. See #36
Multiple processes are supported in node.js by the child process and cluster modules. |
I am having a hard time figuring out how to implement multi-channels and have specific queues listening on specific channels. All the examples in the tutorials seem to be single channel.
The idea is to have a task system where there are priorities. Workers need to work on tasks with high priorities and go to lower priority tasks as the other queues empty out.
For the discussion let's say we have 3 priorities: 1 - really important, 2 - medium importance, 3 - low importance.
Each worker can do up to 5 things at once.
So, I'm thinking about doing this via 3 queues and then have 3 channels each consume from 1 queue setting the channel qos to 5. This should throttle things across cluster workers, although not optimally since I may end up with 15 messages at the worker at any time.
Any examples on how to do that? (or maybe some other way of accomplishing the same thing)
Thanks,
Alberto
The text was updated successfully, but these errors were encountered: