diff --git a/developer/tutorials/pubsub.md b/developer/tutorials/pubsub.md index 2dfdeec..0373382 100644 --- a/developer/tutorials/pubsub.md +++ b/developer/tutorials/pubsub.md @@ -63,13 +63,13 @@ You will use this session to run an example NATS client subscriber program. ### 3. CD to the Go client examples directory ```sh -% cd $GOPATH/src/github.com/nats-io/nats/examples +% cd $GOPATH/src/github.com/nats-io/nats.go/examples ``` ### 4. Run the client subscriber program ```sh -% go run nats-sub.go +% go run nats-sub/main.go ``` Where `` is a subject to listen on. A valid subject is a string that is unique in the system. @@ -77,7 +77,7 @@ Where `` is a subject to listen on. A valid subject is a string that is For example: ```sh -% go run nats-sub.go msg.test +% go run nats-sub/main.go msg.test ``` You should see the message: *Listening on [msg.test]* @@ -89,13 +89,13 @@ You will use this session to run a NATS publisher client. ## 6. CD to the examples directory ```sh -% cd $GOPATH/src/github.com/nats-io/nats/examples +% cd $GOPATH/src/github.com/nats-io/nats.go/examples ``` ### 7. Publish a NATS message ```sh -% go run nats-pub.go +% go run nats-pub/main.go ``` Where `` is the subject name and `` is the text to publish. @@ -103,13 +103,13 @@ Where `` is the subject name and `` is the text to publish. For example: ```sh -% go run nats-pub.go msg.test hello +% go run nats-pub/main.go msg.test hello ``` or ```sh -% go run nats-pub.go msg.test "NATS MESSAGE" +% go run nats-pub/main.go msg.test "NATS MESSAGE" ``` ### 8. Verify message publication and receipt @@ -123,7 +123,7 @@ Note that if the receiver does not get the message, check that you are using the ### 9. Publish another message ```sh -% go run nats-pub.go msg.test "NATS MESSAGE 2" +% go run nats-pub/main.go msg.test "NATS MESSAGE 2" ``` You should see that the subscriber receive message 2. Note that the message count is incremented each time your subscribing client receives a message on that subject: @@ -135,19 +135,19 @@ You will use this session to run a second NATS subscriber. ### 11. CD to the examples directory ```sh -% cd $GOPATH/src/github.com/nats-io/nats/examples +% cd $GOPATH/src/github.com/nats-io/nats.go/examples ``` ### 12. Subscribe to the message ```sh -% go run nats-sub.go msg.test +% go run nats-sub/main.go msg.test ``` ### 13. Publish another message using the publisher client ```sh -% go run nats-pub.go msg.test "NATS MESSAGE 3" +% go run nats-pub/main.go msg.test "NATS MESSAGE 3" ``` Verify that both subscribing clients receive the message. @@ -159,13 +159,13 @@ You will use this session to run a third NATS subscriber. ### 15. CD to the examples directory ```sh -% cd $GOPATH/src/github.com/nats-io/nats/examples +% cd $GOPATH/src/github.com/nats-io/nats.go/examples ``` ### 16. Subscribe to a different message ```sh -% go run nats-sub.go msg.test.new +% go run nats-sub/main.go msg.test.new ``` All the but last subscriber receives the message. Why? Because that subscriber is not listening on the message subject used by the publisher. @@ -177,7 +177,7 @@ NATS supports the use of wildcard characters for message subscribers. You cannot Change the last subscriber the listen on msg.* and run it: ```sh -% go run nats-sub.go msg.* +% go run nats-sub/main.go msg.* ``` ### 18. Publish another message