mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
Update reqreply.md
This commit is contained in:
parent
2947ad8bf8
commit
80d1c694b0
@ -19,13 +19,13 @@ You will use these sessions to run the NATS request and reply clients.
|
|||||||
### 3. Change to the examples directory
|
### 3. Change to the examples directory
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
% cd $GOPATH/src/github.com/nats-io/nats/examples
|
% cd $GOPATH/src/github.com/nats-io/nats.go/examples
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. In one terminal, run the reply client listener
|
### 4. In one terminal, run the reply client listener
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
% go run nats-rply.go foo "this is my response"
|
% go run nats-rply/main.go foo "this is my response"
|
||||||
```
|
```
|
||||||
|
|
||||||
You should see the message `Receiver is listening`, and that the NATS receiver client is listening on the "help.please" subject. The reply client acts as a receiver, listening for message requests. In NATS, the receiver is a subscriber.
|
You should see the message `Receiver is listening`, and that the NATS receiver client is listening on the "help.please" subject. The reply client acts as a receiver, listening for message requests. In NATS, the receiver is a subscriber.
|
||||||
@ -33,7 +33,7 @@ You should see the message `Receiver is listening`, and that the NATS receiver c
|
|||||||
### 5. In the other terminal, run the request client
|
### 5. In the other terminal, run the request client
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
% go run nats-req.go foo "request payload"
|
% go run nats-req/main.go foo "request payload"
|
||||||
```
|
```
|
||||||
|
|
||||||
The NATS requestor client makes a request by sending the message "some message" on the “help.please” subject.
|
The NATS requestor client makes a request by sending the message "some message" on the “help.please” subject.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user