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

Add convenience function to set connection name #108

Merged
merged 2 commits into from Aug 18, 2022

Conversation

Zerpet
Copy link
Contributor

@Zerpet Zerpet commented Aug 10, 2022

RabbitMQ reads the connection property "connection_name" from the client and displays the value in the Management UI. This is convenient for debugging and locating specific client connections, and correlating a connection to an app.

See #105 for more details.

RabbitMQ reads the connection property "connection_name" from the client
and displays the value in the Management UI. This is convenient for
debugging and locating specific client connections, and correlating a
connection to an app.

Showed in the examples how to use this function and added an example in
Go Docs.

Signed-off-by: Aitor Perez Cedres <acedres@vmware.com>
@Zerpet Zerpet added this to the 1.5.0 milestone Aug 10, 2022
@Zerpet Zerpet linked an issue Aug 10, 2022 that may be closed by this pull request
@Zerpet Zerpet requested a review from lukebakken August 16, 2022 11:42
@lukebakken
Copy link
Contributor

Reviewing this today!

Copy link
Contributor

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one question, otherwise :shipit:

@@ -66,7 +66,7 @@ type Consumer struct {
}

func SetupCloseHandler(consumer *Consumer) {
c := make(chan os.Signal)
c := make(chan os.Signal, 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why this change is necessary...???

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go vet was complaining about using unbuffered channels with os.Signal

go vet _examples/simple-consumer/consumer.go                                                                                                                                  
# command-line-arguments
# _examples/simple-consumer/consumer.go:70:2: misuse of unbuffered os.Signal channel as argument to signal.Notify

Happy to remove this and make another PR for govet and any other linter warnings, if you'd prefer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope! I appreciate the explanation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have sworn we run something like go vet in CI. I'll check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the golangci-lint tool we use is scanning only the root directory, and missing the _example directories. Likely same story for go vet ./...

@lukebakken lukebakken merged commit de416f1 into main Aug 18, 2022
@lukebakken lukebakken deleted the 105-provide-a-friendly-way-to-set-connection-name branch August 18, 2022 13:12
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.

Provide a friendly way to set connection name
2 participants