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

RabbitMQ priority #157

Closed
wants to merge 2 commits into from
Closed

RabbitMQ priority #157

wants to merge 2 commits into from

Conversation

davidt99
Copy link
Contributor

Add support to rabbitmq priority queue.
Examples and documentation are still missing, I'll add them after you'll approve it.
The idea is to send the message with options like this:

some_actot.send_with_options(broker_priority=5)

@davidt99
Copy link
Contributor Author

And fixed a bug while writing tests: The worker will start consuming even if it's stopped.

Copy link
Contributor

@ryanhiebert ryanhiebert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks pretty cool, so good work! The implementation is simple enough that I can understand what you're doing, which I think speaks something really good about it. It would be more in line with RabbitMQ if the max priority were defined per queue, but that seems out of place for Dramatiq from what I can tell, as it doesn't seem like Dramatiq wants to have its queues pre-declared, so this change seems reasonable to me.

@davidt99
Copy link
Contributor Author

I was trying to do it with a middleware but the declare queue callback doesn't get the actor option, as described in #91

@ryanhiebert
Copy link
Contributor

I was trying to do it with a middleware but the declare queue callback doesn't get the actor option, as described in #91

Interesting. My thinking is that since queues may be shared between actors, pulling the max_priority off the actor probably doesn't make sense. And even then, the queue need not be declared on the actor, so it's at best an unreliable way to set it. I think what you've written here makes the most sense.

@Bogdanp Bogdanp added this to the v1.5.0 milestone Jan 26, 2019
@davidt99
Copy link
Contributor Author

davidt99 commented Feb 7, 2019

@Bogdanp I rebased and the tests are passing, can you take a look? There are more improvements that I want to make into dramatiq but this PR is on the shelf for almost a month...

@Bogdanp
Copy link
Owner

Bogdanp commented Feb 9, 2019

Thanks! I merged most of your changes with rebase. I added explicit support for pausing consumers in tests as opposed to what you had w/ not starting them at all.

@Bogdanp Bogdanp closed this Feb 9, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants