-
Notifications
You must be signed in to change notification settings - Fork 140
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
Add convenience function to set connection name #108
Conversation
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 <[email protected]>
Reviewing this today! |
There was a problem hiding this 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
@@ -66,7 +66,7 @@ type Consumer struct { | |||
} | |||
|
|||
func SetupCloseHandler(consumer *Consumer) { | |||
c := make(chan os.Signal) | |||
c := make(chan os.Signal, 2) |
There was a problem hiding this comment.
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...???
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ./...
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.