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

Provide a friendly way to set connection name #105

Closed
Zerpet opened this issue Jul 19, 2022 · 1 comment · Fixed by #108
Closed

Provide a friendly way to set connection name #105

Zerpet opened this issue Jul 19, 2022 · 1 comment · Fixed by #108
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Zerpet
Copy link
Contributor

Zerpet commented Jul 19, 2022

The client provided connection name is very useful to identify connections in Management UI and during debugging sessions. In the Java Client, it's quite easy to set a client provided name with ConnectionFactory.newConnection(string clientName). In this client, a user has to set a configuration property with a specific name, for example:

connection, err := amqp.DialConfig(
		amqpURI,
		amqp.Config{Properties: map[string]interface{}{"connection_name": "sample-producer"}},
	)

This isn't great because the user is required to know the property key connection_name and the Properties map has to be crafted manually.

We should either provide a simple function like amqp.SetConnectionName(amqp.Config, string), or a constant with the connection name key (and any other well-known properties).

@Zerpet Zerpet added the enhancement New feature or request label Jul 19, 2022
@lukebakken
Copy link
Contributor

lukebakken commented Jul 19, 2022

Is this documented at least?

Seems like providing a way to build the Config's Properties map could work.

This is sure a good example of how Golang can be ugly!

map[string]interface{}{"connection_name": "sample-producer"}}

...ugh!

@lukebakken lukebakken added this to the 1.5.0 milestone Jul 19, 2022
@Zerpet Zerpet self-assigned this Aug 8, 2022
@Zerpet Zerpet linked a pull request Aug 10, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants