Fix issues with using the RABBITMQ_URL environment variable #403

Merged
merged 1 commit into from May 13, 2016

Projects

None yet

2 participants

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

@jipe jipe Default to ENV['RABBITMQ_URL'] when no connection argument is given
- 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.
e5d8cb3
@michaelklishin michaelklishin self-assigned this May 13, 2016
@michaelklishin michaelklishin merged commit a41ef1b into ruby-amqp:master May 13, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment