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

Changing the subscription subject from a hard-coded value #194

Closed

Conversation

Guitarbum722
Copy link
Contributor

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.

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'
@petemiron petemiron self-assigned this Feb 15, 2017
@petemiron petemiron assigned kozlovic and unassigned kozlovic Feb 15, 2017
Copy link
Member

@kozlovic kozlovic left a 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"
Copy link
Member

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()
}
Copy link
Member

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)
Copy link
Member

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 ;-)

@petemiron
Copy link
Contributor

@Guitarbum722 I'm going to cancel this request. I've opened a new PR #210 to include your fix and @kozlovic feedback.

@petemiron petemiron closed this Feb 15, 2017
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.

None yet

3 participants