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

Creating and passing an AMQP connection in config #425

Open
ionutzp opened this issue Jan 15, 2020 · 0 comments
Open

Creating and passing an AMQP connection in config #425

ionutzp opened this issue Jan 15, 2020 · 0 comments

Comments

@ionutzp
Copy link

ionutzp commented Jan 15, 2020

Hello all, @jondot
I am trying to implement Sneakers in an existing web application and I am trying to reuse an existing amqp connection. I've passed it in the connection as a configuration option:

Sneakers.configure(
  connection: InstantiateAMQPConnection,
  heartbeat: 30,
...

I'm getting a timeout and i think it's related to the forking for Sneakers:

Unexpected error Timeout::Error
  .../gems/bunny-2.14.3/lib/bunny/concurrent/continuation_queue.rb:39:in `block in poll'
  .../gems/bunny-2.14.3/lib/bunny/concurrent/continuation_queue.rb:30:in `synchronize'
  .../gems/bunny-2.14.3/lib/bunny/concurrent/continuation_queue.rb:30:in `poll'
  .../gems/bunny-2.14.3/lib/bunny/session.rb:1372:in `wait_on_continuations'
  .../gems/bunny-2.14.3/lib/bunny/session.rb:535:in `block in open_channel'
  /home/vagrant/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
  .../gems/bunny-2.14.3/lib/bunny/session.rb:528:in `open_channel'
  .../gems/bunny-2.14.3/lib/bunny/channel.rb:234:in `open'
  .../gems/bunny-2.14.3/lib/bunny/session.rb:365:in `block in create_channel'
  /home/vagrant/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
  .../gems/bunny-2.14.3/lib/bunny/session.rb:360:in `create_channel'
  .../gems/sneakers-2.11.0/lib/sneakers/queue.rb:25:in `subscribe'

That means that it would be safer to pass connection details so that each worker can open their own connection to rabbit? (lib/sneakers/worker.rb)
http://rubybunny.info/articles/connecting.html#connecting_in_web_applications_ruby_on_rails_sinatra_etc

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

No branches or pull requests

1 participant