1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

updating docs

This commit is contained in:
ainsley
2019-05-30 12:43:58 -05:00
parent 0ce229b29d
commit 7765f4b86a
162 changed files with 426 additions and 307 deletions

View File

@@ -2305,19 +2305,19 @@
<p>NATS supports request/reply messaging. In this tutorial you explore how to exchange point-to-point messages using NATS.</p>
<h2 id="prerequisites"><a name="prerequisites" class="plugin-anchor" href="#prerequisites"><i class="fa fa-link" aria-hidden="true"></i></a>Prerequisites</h2>
<p>Go and the NATS server should be installed.</p>
<h2 id="1-start-the-nats-server"><a name="1-start-the-nats-server" class="plugin-anchor" href="#1-start-the-nats-server"><i class="fa fa-link" aria-hidden="true"></i></a>1. Start the NATS server</h2>
<h3 id="1-start-the-nats-server"><a name="1-start-the-nats-server" class="plugin-anchor" href="#1-start-the-nats-server"><i class="fa fa-link" aria-hidden="true"></i></a>1. Start the NATS server</h3>
<pre class="language-"><code class="lang-sh">% nats-server
</code></pre>
<h2 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</h2>
<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>
<h2 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</h2>
<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
</code></pre>
<h2 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</h2>
<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">&quot;this is my response&quot;</span>
</code></pre>
<p>You should see the message <code>Receiver is listening</code>, and that the NATS receiver client is listening on the &quot;help.please&quot; subject. The reply client acts as a receiver, listening for message requests. In NATS, the receiver is a subscriber.</p>
<h2 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</h2>
<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">&quot;request payload&quot;</span>
</code></pre>
<p>The NATS requestor client makes a request by sending the message &quot;some message&quot; on the &#x201C;help.please&#x201D; subject.</p>
@@ -2365,7 +2365,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","-highlight","include-html","toggle-chapters","anchors"],"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},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"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-29T16:43:54.760Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-29T16:45:48.381Z"},"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","-highlight","include-html","toggle-chapters","anchors"],"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},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"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-30T17:42:13.282Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-30T17:42:48.393Z"},"basePath":"../..","book":{"language":""}});
});
</script>
</div>