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

Fix issues with using the RABBITMQ_URL environment variable #403

Merged
merged 1 commit into from
May 13, 2016
Merged

Conversation

jipe
Copy link
Contributor

@jipe jipe commented May 13, 2016

I experienced some issues when trying to have two Bunny instances at the same time, where one would be instantiated using Bunny.new (with a connection string set in the RABBITMQ_URL environment variable) and the other would be instantiated using Bunny.new(some_connection_string). Apparently both instances would then use the connection string from the RABBITMQ_URL environment variable.

This PR is a fix to that issue, so when a Bunny is instantiated given a specific connection string (or hash), it will disregard the RABBITMQ_URL environment variable and when Bunny is instantiated without a connection argument, it will default to use value of a look-up of the RABBITMQ_URL environment variable.

- Bunny.new and Bunny.run now defaults to ENV['RABBITMQ_URL'] for connection
  argument.
- Session.new now only uses ENV['RABBITMQ_URL'] for connection argument
  when no other argument is given.
@michaelklishin michaelklishin self-assigned this May 13, 2016
@michaelklishin michaelklishin merged commit a41ef1b into ruby-amqp:master May 13, 2016
michaelklishin added a commit that referenced this pull request Sep 14, 2016
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.

2 participants