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

synchronize channel actions that happen in the threadpool #69

Merged
merged 4 commits into from
Sep 12, 2016
Merged

Conversation

mmmries
Copy link
Contributor

@mmmries mmmries commented Sep 12, 2016

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

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
Copy link
Contributor

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 ... ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That must be a new thing. It looks like the top-level Mutex is documented in both 2.2.0 and in 1.9.3 so I'll use that instead.

@brianbroderick
Copy link

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!
Copy link
Contributor Author

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. 🌈

@abrandoned
Copy link
Contributor

:shipit:

@mmmries mmmries merged commit 174fddf into master Sep 12, 2016
@mmmries mmmries deleted the lock_acks branch September 12, 2016 17:50
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.

3 participants