mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
updating docs
This commit is contained in:
@@ -2522,7 +2522,7 @@ WaitForEstablishedConnection<span class="token punctuation">:</span>
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Advanced Connect and Custom Dialer in Go","level":"3.8.4","depth":2,"next":{"title":"Installing","level":"4.1","depth":1,"path":"nats_server/installation.md","ref":"nats_server/installation.md","articles":[]},"previous":{"title":"Explore NATS Queueing","level":"3.8.3","depth":2,"path":"developer/tutorials/queues.md","ref":"developer/tutorials/queues.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/custom_dialer.md","mtime":"2019-06-05T22:32:07.013Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T15:52:44.448Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Advanced Connect and Custom Dialer in Go","level":"3.8.4","depth":2,"next":{"title":"Installing","level":"4.1","depth":1,"path":"nats_server/installation.md","ref":"nats_server/installation.md","articles":[]},"previous":{"title":"Explore NATS Queueing","level":"3.8.3","depth":2,"path":"developer/tutorials/queues.md","ref":"developer/tutorials/queues.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/custom_dialer.md","mtime":"2019-06-05T22:32:07.013Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T20:59:59.144Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -2404,7 +2404,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Tutorials","level":"3.8","depth":1,"next":{"title":"Explore NATS Pub/Sub","level":"3.8.1","depth":2,"path":"developer/tutorials/pubsub.md","ref":"developer/tutorials/pubsub.md","articles":[]},"previous":{"title":"Slow Consumers","level":"3.7.2","depth":2,"path":"developer/events/slow.md","ref":"developer/events/slow.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/intro.md","mtime":"2019-05-31T18:06:28.938Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T15:52:44.448Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Tutorials","level":"3.8","depth":1,"next":{"title":"Explore NATS Pub/Sub","level":"3.8.1","depth":2,"path":"developer/tutorials/pubsub.md","ref":"developer/tutorials/pubsub.md","articles":[]},"previous":{"title":"Slow Consumers","level":"3.7.2","depth":2,"path":"developer/events/slow.md","ref":"developer/events/slow.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/intro.md","mtime":"2019-05-31T18:06:28.938Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T20:59:59.144Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -2403,64 +2403,64 @@ digraph nats_pub_sub {
|
||||
<h3 id="2-start-a-shell-or-command-prompt-session"><a name="2-start-a-shell-or-command-prompt-session" class="plugin-anchor" href="#2-start-a-shell-or-command-prompt-session"><i class="fa fa-link" aria-hidden="true"></i></a>2. Start a shell or command prompt session</h3>
|
||||
<p>You will use this session to run an example NATS client subscriber program.</p>
|
||||
<h3 id="3-cd-to-the-go-client-examples-directory"><a name="3-cd-to-the-go-client-examples-directory" class="plugin-anchor" href="#3-cd-to-the-go-client-examples-directory"><i class="fa fa-link" aria-hidden="true"></i></a>3. CD to the Go client 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-run-the-client-subscriber-program"><a name="4-run-the-client-subscriber-program" class="plugin-anchor" href="#4-run-the-client-subscriber-program"><i class="fa fa-link" aria-hidden="true"></i></a>4. Run the client subscriber program</h3>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub.go <span class="token operator"><</span>subject<span class="token operator">></span>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub/main.go <span class="token operator"><</span>subject<span class="token operator">></span>
|
||||
</code></pre>
|
||||
<p>Where <code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>subject</span><span class="token punctuation">></span></span></code> is a subject to listen on. A valid subject is a string that is unique in the system.</p>
|
||||
<p>For example:</p>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub.go msg.test
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub/main.go msg.test
|
||||
</code></pre>
|
||||
<p>You should see the message: <em>Listening on [msg.test]</em></p>
|
||||
<h3 id="5-start-another-shell-or-command-prompt-session"><a name="5-start-another-shell-or-command-prompt-session" class="plugin-anchor" href="#5-start-another-shell-or-command-prompt-session"><i class="fa fa-link" aria-hidden="true"></i></a>5. Start another shell or command prompt session</h3>
|
||||
<p>You will use this session to run a NATS publisher client.</p>
|
||||
<h2 id="6-cd-to-the-examples-directory"><a name="6-cd-to-the-examples-directory" class="plugin-anchor" href="#6-cd-to-the-examples-directory"><i class="fa fa-link" aria-hidden="true"></i></a>6. CD to the examples directory</h2>
|
||||
<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="7-publish-a-nats-message"><a name="7-publish-a-nats-message" class="plugin-anchor" href="#7-publish-a-nats-message"><i class="fa fa-link" aria-hidden="true"></i></a>7. Publish a NATS message</h3>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub.go <span class="token operator"><</span>subject<span class="token operator">></span> <span class="token operator"><</span>message<span class="token operator">></span>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub/main.go <span class="token operator"><</span>subject<span class="token operator">></span> <span class="token operator"><</span>message<span class="token operator">></span>
|
||||
</code></pre>
|
||||
<p>Where <code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>subject</span><span class="token punctuation">></span></span></code> is the subject name and <code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>message</span><span class="token punctuation">></span></span></code> is the text to publish.</p>
|
||||
<p>For example:</p>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub.go msg.test hello
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub/main.go msg.test hello
|
||||
</code></pre>
|
||||
<p>or</p>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub.go msg.test <span class="token string">"NATS MESSAGE"</span>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub/main.go msg.test <span class="token string">"NATS MESSAGE"</span>
|
||||
</code></pre>
|
||||
<h3 id="8-verify-message-publication-and-receipt"><a name="8-verify-message-publication-and-receipt" class="plugin-anchor" href="#8-verify-message-publication-and-receipt"><i class="fa fa-link" aria-hidden="true"></i></a>8. Verify message publication and receipt</h3>
|
||||
<p>You should see that the publisher sends the message: <em>Published [msg.test] : 'NATS MESSAGE'</em></p>
|
||||
<p>And that the subscriber receives the message: <em>[#1] Received on [msg.test]: 'NATS MESSAGE'</em></p>
|
||||
<p>Note that if the receiver does not get the message, check that you are using the same subject name for the publisher and the subscriber.</p>
|
||||
<h3 id="9-publish-another-message"><a name="9-publish-another-message" class="plugin-anchor" href="#9-publish-another-message"><i class="fa fa-link" aria-hidden="true"></i></a>9. Publish another message</h3>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub.go msg.test <span class="token string">"NATS MESSAGE 2"</span>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub/main.go msg.test <span class="token string">"NATS MESSAGE 2"</span>
|
||||
</code></pre>
|
||||
<p>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:</p>
|
||||
<h3 id="10-start-another-shell-or-command-prompt-session"><a name="10-start-another-shell-or-command-prompt-session" class="plugin-anchor" href="#10-start-another-shell-or-command-prompt-session"><i class="fa fa-link" aria-hidden="true"></i></a>10. Start another shell or command prompt session</h3>
|
||||
<p>You will use this session to run a second NATS subscriber.</p>
|
||||
<h3 id="11-cd-to-the-examples-directory"><a name="11-cd-to-the-examples-directory" class="plugin-anchor" href="#11-cd-to-the-examples-directory"><i class="fa fa-link" aria-hidden="true"></i></a>11. CD 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="12-subscribe-to-the-message"><a name="12-subscribe-to-the-message" class="plugin-anchor" href="#12-subscribe-to-the-message"><i class="fa fa-link" aria-hidden="true"></i></a>12. Subscribe to the message</h3>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub.go msg.test
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub/main.go msg.test
|
||||
</code></pre>
|
||||
<h3 id="13-publish-another-message-using-the-publisher-client"><a name="13-publish-another-message-using-the-publisher-client" class="plugin-anchor" href="#13-publish-another-message-using-the-publisher-client"><i class="fa fa-link" aria-hidden="true"></i></a>13. Publish another message using the publisher client</h3>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub.go msg.test <span class="token string">"NATS MESSAGE 3"</span>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-pub/main.go msg.test <span class="token string">"NATS MESSAGE 3"</span>
|
||||
</code></pre>
|
||||
<p>Verify that both subscribing clients receive the message.</p>
|
||||
<h3 id="14-start-another-shell-or-command-prompt-session"><a name="14-start-another-shell-or-command-prompt-session" class="plugin-anchor" href="#14-start-another-shell-or-command-prompt-session"><i class="fa fa-link" aria-hidden="true"></i></a>14. Start another shell or command prompt session</h3>
|
||||
<p>You will use this session to run a third NATS subscriber.</p>
|
||||
<h3 id="15-cd-to-the-examples-directory"><a name="15-cd-to-the-examples-directory" class="plugin-anchor" href="#15-cd-to-the-examples-directory"><i class="fa fa-link" aria-hidden="true"></i></a>15. CD 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="16-subscribe-to-a-different-message"><a name="16-subscribe-to-a-different-message" class="plugin-anchor" href="#16-subscribe-to-a-different-message"><i class="fa fa-link" aria-hidden="true"></i></a>16. Subscribe to a different message</h3>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub.go msg.test.new
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub/main.go msg.test.new
|
||||
</code></pre>
|
||||
<p>All the but last subscriber receives the message. Why? Because that subscriber is not listening on the message subject used by the publisher.</p>
|
||||
<h3 id="17-update-the-last-subscriber-to-use-a-wildcard"><a name="17-update-the-last-subscriber-to-use-a-wildcard" class="plugin-anchor" href="#17-update-the-last-subscriber-to-use-a-wildcard"><i class="fa fa-link" aria-hidden="true"></i></a>17. Update the last subscriber to use a wildcard</h3>
|
||||
<p>NATS supports the use of wildcard characters for message subscribers. You cannot publish a message using a wildcard subject.</p>
|
||||
<p>Change the last subscriber the listen on msg.* and run it:</p>
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub.go msg.*
|
||||
<pre class="language-"><code class="lang-sh">% go run nats-sub/main.go msg.*
|
||||
</code></pre>
|
||||
<h3 id="18-publish-another-message"><a name="18-publish-another-message" class="plugin-anchor" href="#18-publish-another-message"><i class="fa fa-link" aria-hidden="true"></i></a>18. Publish another message</h3>
|
||||
<p>This time, all three subscribing clients should receive the message.</p>
|
||||
@@ -2507,7 +2507,7 @@ digraph nats_pub_sub {
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Explore NATS Pub/Sub","level":"3.8.1","depth":2,"next":{"title":"Explore NATS Request/Reply","level":"3.8.2","depth":2,"path":"developer/tutorials/reqreply.md","ref":"developer/tutorials/reqreply.md","articles":[]},"previous":{"title":"Tutorials","level":"3.8","depth":1,"path":"developer/tutorials/intro.md","ref":"developer/tutorials/intro.md","articles":[{"title":"Explore NATS Pub/Sub","level":"3.8.1","depth":2,"path":"developer/tutorials/pubsub.md","ref":"developer/tutorials/pubsub.md","articles":[]},{"title":"Explore NATS Request/Reply","level":"3.8.2","depth":2,"path":"developer/tutorials/reqreply.md","ref":"developer/tutorials/reqreply.md","articles":[]},{"title":"Explore NATS Queueing","level":"3.8.3","depth":2,"path":"developer/tutorials/queues.md","ref":"developer/tutorials/queues.md","articles":[]},{"title":"Advanced Connect and Custom Dialer in Go","level":"3.8.4","depth":2,"path":"developer/tutorials/custom_dialer.md","ref":"developer/tutorials/custom_dialer.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/pubsub.md","mtime":"2019-06-07T16:09:25.588Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T15:52:44.448Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Explore NATS Pub/Sub","level":"3.8.1","depth":2,"next":{"title":"Explore NATS Request/Reply","level":"3.8.2","depth":2,"path":"developer/tutorials/reqreply.md","ref":"developer/tutorials/reqreply.md","articles":[]},"previous":{"title":"Tutorials","level":"3.8","depth":1,"path":"developer/tutorials/intro.md","ref":"developer/tutorials/intro.md","articles":[{"title":"Explore NATS Pub/Sub","level":"3.8.1","depth":2,"path":"developer/tutorials/pubsub.md","ref":"developer/tutorials/pubsub.md","articles":[]},{"title":"Explore NATS Request/Reply","level":"3.8.2","depth":2,"path":"developer/tutorials/reqreply.md","ref":"developer/tutorials/reqreply.md","articles":[]},{"title":"Explore NATS Queueing","level":"3.8.3","depth":2,"path":"developer/tutorials/queues.md","ref":"developer/tutorials/queues.md","articles":[]},{"title":"Advanced Connect and Custom Dialer in Go","level":"3.8.4","depth":2,"path":"developer/tutorials/custom_dialer.md","ref":"developer/tutorials/custom_dialer.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/pubsub.md","mtime":"2019-06-14T20:59:44.926Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T20:59:59.144Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -2362,8 +2362,8 @@
|
||||
</code></pre>
|
||||
<h3 id="2-clone-the-repositories-for-each-client-examples"><a name="2-clone-the-repositories-for-each-client-examples" class="plugin-anchor" href="#2-clone-the-repositories-for-each-client-examples"><i class="fa fa-link" aria-hidden="true"></i></a>2. Clone the repositories for each client examples</h3>
|
||||
<pre class="language-"><code class="lang-sh">go get github.com/nats-io/nats.go
|
||||
<span class="token function">git</span> clone https://github.com/nats-io/node-nats.git
|
||||
<span class="token function">git</span> clone https://github.com/nats-io/ruby-nats.git
|
||||
<span class="token function">git</span> clone https://github.com/nats-io/nats.js.git
|
||||
<span class="token function">git</span> clone https://github.com/nats-io/nats.rb.git
|
||||
</code></pre>
|
||||
<h3 id="3-run-the-go-client-subscriber-with-queue-group-name"><a name="3-run-the-go-client-subscriber-with-queue-group-name" class="plugin-anchor" href="#3-run-the-go-client-subscriber-with-queue-group-name"><i class="fa fa-link" aria-hidden="true"></i></a>3. Run the Go client subscriber with queue group name</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.go/examples
|
||||
@@ -2371,7 +2371,7 @@ go run nats-qsub/main.go foo my-queue
|
||||
</code></pre>
|
||||
<h3 id="4-install-and-run-the-node-client-subscriber-with-queue-group-name"><a name="4-install-and-run-the-node-client-subscriber-with-queue-group-name" class="plugin-anchor" href="#4-install-and-run-the-node-client-subscriber-with-queue-group-name"><i class="fa fa-link" aria-hidden="true"></i></a>4. Install and run the Node client subscriber with queue group name</h3>
|
||||
<pre class="language-"><code class="lang-sh"><span class="token function">npm</span> <span class="token function">install</span> nats
|
||||
<span class="token function">cd</span> node-nats/examples
|
||||
<span class="token function">cd</span> nats.js/examples
|
||||
node node-sub foo my-queue
|
||||
</code></pre>
|
||||
<h3 id="5-install-and-run-the-ruby-client-subscriber-with-queue-group-name"><a name="5-install-and-run-the-ruby-client-subscriber-with-queue-group-name" class="plugin-anchor" href="#5-install-and-run-the-ruby-client-subscriber-with-queue-group-name"><i class="fa fa-link" aria-hidden="true"></i></a>5. Install and run the Ruby client subscriber with queue group name</h3>
|
||||
@@ -2436,7 +2436,7 @@ go run nats-pub/main.go foo <span class="token string">"Hello NATS!"</
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Explore NATS Queueing","level":"3.8.3","depth":2,"next":{"title":"Advanced Connect and Custom Dialer in Go","level":"3.8.4","depth":2,"path":"developer/tutorials/custom_dialer.md","ref":"developer/tutorials/custom_dialer.md","articles":[]},"previous":{"title":"Explore NATS Request/Reply","level":"3.8.2","depth":2,"path":"developer/tutorials/reqreply.md","ref":"developer/tutorials/reqreply.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/queues.md","mtime":"2019-06-11T19:34:10.865Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T15:52:44.448Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Explore NATS Queueing","level":"3.8.3","depth":2,"next":{"title":"Advanced Connect and Custom Dialer in Go","level":"3.8.4","depth":2,"path":"developer/tutorials/custom_dialer.md","ref":"developer/tutorials/custom_dialer.md","articles":[]},"previous":{"title":"Explore NATS Request/Reply","level":"3.8.2","depth":2,"path":"developer/tutorials/reqreply.md","ref":"developer/tutorials/reqreply.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/queues.md","mtime":"2019-06-14T20:59:44.927Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-06-14T20:59:59.144Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -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