-
Notifications
You must be signed in to change notification settings - Fork 21
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
synchronize channel actions that happen in the threadpool #69
Conversation
Accessing channels from multiple threads for messsage acknowledgement will crash a channel and stop messages from being received on that channel this isn't very clear in the documentation for march_hare/bunny, but it is explicitly addresses here: rabbitmq/rabbitmq-java-client#53
class Synchronizer | ||
def initialize(delegate) | ||
@delegate = delegate | ||
@mutex = ::Thread::Mutex.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a ruby-2 thing, but thought Mutex was a top level class ::Mutex
... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for looking into this. |
@@ -7,6 +7,12 @@ def cancel_consumers! | |||
march_hare_consumers.each(&:cancel) | |||
end | |||
|
|||
def create_queue(channel, queue_name, queue_options) | |||
queue = ::MarchHare::Queue.new(channel, queue_name, queue_options) | |||
queue.declare! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those integration tests just saved my bacon again! It turns out that building a queue explicitly like this doesn't automatically declare it with the broker the way channel.queue
does. 🌈
Accessing channels from multiple threads for messsage acknowledgement will crash a channel and stop messages from being received on that channel this isn't very clear in the documentation for march_hare/bunny, but it is explicitly addressed here: rabbitmq/rabbitmq-java-client#53
/cc @quixoten @abrandoned @brettallred @brianbroderick