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

Take connection_name from options parameter and make it a new standard #167

Merged
merged 6 commits into from
Jun 19, 2020

Conversation

ono
Copy link
Collaborator

@ono ono commented May 25, 2020

Additional work for #165. Taking connection_name from options is more intuitive and concise for Connection.open. Therefore this PR makes it as a new standard while supporting a backward compatibility.

  1. Support connection_name option in Connection.open/1 and Connection.open/2
  2. Deprecated connection_name parameter on Connection.open/* and recommend to use options
  3. Still support connection_name parameter to support backward compatibility

@ono ono force-pushed the feature/open-with-connection-name branch from b73cd67 to f1ba2c3 Compare May 25, 2020 17:03
@ono
Copy link
Collaborator Author

ono commented Jun 3, 2020

I have been thinking about connection_name v.s. name as an option key for this. I personally prefer name as it's obvious enough what it is for and connection_ prefix seems to be unnecessary.

However I keep it calling connection_name because:

  • the parameter is referred as ConnectionName or ConnName by amqp_client [*1]
  • we might want to avoid a chance mixing up with username or hostname

[*1]
https://github.com/rabbitmq/rabbitmq-erlang-client/blob/master/src/amqp_connection.erl#L149

I'm planning to merge and release a new version in this week.

@ono
Copy link
Collaborator Author

ono commented Jun 19, 2020

Sorry for the delay - I couldn't have spent time on the project.

I also argued again by myself and decided to go for name for the option key instead of connection_name. It looks concise and better and is obvious enough it's a name of the connection you are opening.

AMQP.Connection.open("amqp://guest:guest@localhost", connection_name: "my-connection")
AMQP.Connection.open("amqp://guest:guest@localhost", name: "my-connection")

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