mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
updating docs
This commit is contained in:
@@ -2363,14 +2363,14 @@
|
||||
<h3 id="2-start-two-terminal-sessions"><a name="2-start-two-terminal-sessions" class="plugin-anchor" href="#2-start-two-terminal-sessions"><i class="fa fa-link" aria-hidden="true"></i></a>2. Start two terminal sessions</h3>
|
||||
<p>You will use these sessions to run the NATS request and reply clients.</p>
|
||||
<h3 id="3-change-to-the-examples-directory"><a name="3-change-to-the-examples-directory" class="plugin-anchor" href="#3-change-to-the-examples-directory"><i class="fa fa-link" aria-hidden="true"></i></a>3. Change to the examples directory</h3>
|
||||
<pre class="language-"><code class="lang-sh">% <span class="token function">cd</span> <span class="token variable">$GOPATH</span>/src/github.com/nats-io/nats/examples
|
||||
<pre class="language-"><code class="lang-sh">% <span class="token function">cd</span> <span class="token variable">$GOPATH</span>/src/github.com/nats-io/nats.go/examples
|
||||
</code></pre>
|
||||
<h3 id="4-in-one-terminal-run-the-reply-client-listener"><a name="4-in-one-terminal-run-the-reply-client-listener" class="plugin-anchor" href="#4-in-one-terminal-run-the-reply-client-listener"><i class="fa fa-link" aria-hidden="true"></i></a>4. In one terminal, run the reply client listener</h3>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-rply.go foo <span class="token string">"this is my response"</span>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-rply/main.go foo <span class="token string">"this is my response"</span>
|
||||
</code></pre>
|
||||
<p>You should see the message <code>Receiver is listening</code>, 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.</p>
|
||||
<h3 id="5-in-the-other-terminal-run-the-request-client"><a name="5-in-the-other-terminal-run-the-request-client" class="plugin-anchor" href="#5-in-the-other-terminal-run-the-request-client"><i class="fa fa-link" aria-hidden="true"></i></a>5. In the other terminal, run the request client</h3>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-req.go foo <span class="token string">"request payload"</span>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-req/main.go foo <span class="token string">"request payload"</span>
|
||||
</code></pre>
|
||||
<p>The NATS requestor client makes a request by sending the message "some message" on the “help.please” subject.</p>
|
||||
<p>The NATS receiver client receives the message, formulates the reply ("OK, I CAN HELP!!!), and sends it to the inbox of the requester.</p>
|
||||
@@ -2417,7 +2417,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Explore NATS Request/Reply","level":"3.8.2","depth":2,"next":{"title":"Explore NATS Queueing","level":"3.8.3","depth":2,"path":"developer/tutorials/queues.md","ref":"developer/tutorials/queues.md","articles":[]},"previous":{"title":"Explore NATS Pub/Sub","level":"3.8.1","depth":2,"path":"developer/tutorials/pubsub.md","ref":"developer/tutorials/pubsub.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"developer/tutorials/reqreply.md","mtime":"2019-05-31T18:06:28.939Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T15:52:44.448Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Explore NATS Request/Reply","level":"3.8.2","depth":2,"next":{"title":"Explore NATS Queueing","level":"3.8.3","depth":2,"path":"developer/tutorials/queues.md","ref":"developer/tutorials/queues.md","articles":[]},"previous":{"title":"Explore NATS Pub/Sub","level":"3.8.1","depth":2,"path":"developer/tutorials/pubsub.md","ref":"developer/tutorials/pubsub.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"developer/tutorials/reqreply.md","mtime":"2019-06-14T20:59:44.928Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T20:59:59.144Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user