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
Changing the subscription subject from a hard-coded value #194
Conversation
The instructions in 'nats-client-dev.md' provide a command line argument of 'foo.' However, 'foo' was hard-coded. Now it will subscribe to the subject provided by the argument, and will default to 'foo'
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.
Sorry for the very long delay in getting back to you.
There are few changes needed before merging, let me know if you can do it or if you want us to do that for you.
"runtime" | ||
|
||
"github.com/nats-io/go-nats" | ||
) | ||
"github.com/nats-io/nats" |
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.
This needs to be go-nats
, not nats
|
||
// Keep the connection alive | ||
runtime.Goexit() | ||
} |
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.
Add a new line and please do:
gofmt -w async-sub.go
to get proper go formatting.
} | ||
// Create server connection: auth and no auth | ||
// natsConnection, _ := nats.Connect("nats://foo:bar@localhost:4222") | ||
natsConnection, _ := nats.Connect(nats.DefaultURL) |
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.
Not to your making, but not checking for error here is a bit wrong because if user forgets to run the NATS Server, this program will not complain but will not receive any message. Hopefully, the sender program will complain about not being able to connect ;-)
@Guitarbum722 I'm going to cancel this request. I've opened a new PR #210 to include your fix and @kozlovic feedback. |
The instructions in
nats-client-dev.md
provide a command line argument offoo
. However,foo
was hard-coded. Now it will subscribe to the subject provided by the argument, and will default tofoo
.