mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
705 lines
21 KiB
HTML
705 lines
21 KiB
HTML
|
|
<!DOCTYPE HTML>
|
|
<html lang="" >
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
<title>Introduction ยท NATS</title>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="description" content="">
|
|
<meta name="generator" content="GitBook 3.2.3">
|
|
<meta name="author" content="The NATS Maintainers">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/style.css">
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism.css">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<meta name="HandheldFriendly" content="true"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
|
|
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
|
|
|
|
|
|
<link rel="next" href="nats_server/" />
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.6.95/css/materialdesignicons.min.css">
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<div class="book">
|
|
<div class="book-summary">
|
|
|
|
|
|
<div id="book-search-input" role="search">
|
|
<input type="text" placeholder="Type to search" />
|
|
</div>
|
|
|
|
|
|
<nav role="navigation">
|
|
|
|
|
|
|
|
<ul class="summary">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="chapter active" data-level="1.1" data-path="./">
|
|
|
|
<a href="./">
|
|
|
|
|
|
Introduction
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.2" data-path="nats_server/">
|
|
|
|
<a href="nats_server/">
|
|
|
|
|
|
NATS Server
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.2.1" data-path="nats_server/installation.html">
|
|
|
|
<a href="nats_server/installation.html">
|
|
|
|
|
|
Installing
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.2.2" data-path="nats_server/running.html">
|
|
|
|
<a href="nats_server/running.html">
|
|
|
|
|
|
Running
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.2.3" data-path="nats_server/clients.html">
|
|
|
|
<a href="nats_server/clients.html">
|
|
|
|
|
|
Clients
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.3" data-path="developer/">
|
|
|
|
<a href="developer/">
|
|
|
|
|
|
Developing with NATS
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.3.1" data-path="developer/connecting.html">
|
|
|
|
<a href="developer/connecting.html">
|
|
|
|
|
|
Connecting
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li class="divider"></li>
|
|
|
|
<li>
|
|
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
|
|
Published with GitBook
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="book-body">
|
|
|
|
<div class="body-inner">
|
|
|
|
|
|
|
|
<div class="book-header" role="navigation">
|
|
|
|
|
|
<!-- Title -->
|
|
<h1>
|
|
<i class="fa fa-circle-o-notch fa-spin"></i>
|
|
<a href="." >Introduction</a>
|
|
</h1>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="page-wrapper" tabindex="-1" role="main">
|
|
<div class="page-inner">
|
|
|
|
<div id="book-search-results">
|
|
<div class="search-noresults">
|
|
|
|
<section class="normal markdown-section">
|
|
|
|
<h1 id="introduction">Introduction</h1>
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
<div class="search-results">
|
|
<div class="has-results">
|
|
|
|
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
|
<ul class="search-results-list"></ul>
|
|
|
|
</div>
|
|
<div class="no-results">
|
|
|
|
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a href="nats_server/" class="navigation navigation-next navigation-unique" aria-label="Next page: NATS Server">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<script>
|
|
var gitbook = gitbook || [];
|
|
gitbook.push(function() {
|
|
gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"NATS Server","level":"1.2","depth":1,"path":"nats_server/README.md","ref":"nats_server/README.md","articles":[{"title":"Installing","level":"1.2.1","depth":2,"path":"nats_server/installation.md","ref":"nats_server/installation.md","articles":[]},{"title":"Running","level":"1.2.2","depth":2,"path":"nats_server/running.md","ref":"nats_server/running.md","articles":[]},{"title":"Clients","level":"1.2.3","depth":2,"path":"nats_server/clients.md","ref":"nats_server/clients.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html"],"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":{},"include-html":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"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}},"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":"README.md","mtime":"2019-05-13T22:01:38.511Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-15T17:41:03.846Z"},"basePath":".","book":{"language":""}});
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
<!-- Viz Support -->
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/viz.js/2.1.2/viz.js"> </script>
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/viz.js/2.1.2/lite.render.js"> </script>
|
|
|
|
<!-- Site code -->
|
|
<script>
|
|
function flash(elem, text, speed) {
|
|
if (!elem) {
|
|
return;
|
|
}
|
|
var s = elem.style;
|
|
elem.textContent = text;
|
|
s.display = 'block';
|
|
s.opacity = 1;
|
|
(function fade() {
|
|
(s.opacity -= .1) < .1 ? s.display = "none" : setTimeout(fade, speed)
|
|
})();
|
|
}
|
|
|
|
function copyToClipboard(text, el) {
|
|
var copyTest = document.queryCommandSupported('copy');
|
|
var elOriginalText = el.getAttribute('data-original-title');
|
|
|
|
if (copyTest === true) {
|
|
var copyTextArea = document.createElement("textarea");
|
|
copyTextArea.value = text;
|
|
document.body.appendChild(copyTextArea);
|
|
copyTextArea.select();
|
|
try {
|
|
var successful = document.execCommand('copy');
|
|
var msg = successful ? 'Copied!' : 'Whoops, not copied!';
|
|
var parent = el.parentNode.parentNode;
|
|
var msgElem = parent.querySelector(".copy-msg");
|
|
flash(msgElem, msg, 100);
|
|
} catch (err) {
|
|
console.log('Oops, unable to copy', err);
|
|
}
|
|
document.body.removeChild(copyTextArea);
|
|
el.setAttribute('data-original-title', elOriginalText);
|
|
} else {
|
|
// Fallback if browser doesn't support .execCommand('copy')
|
|
window.prompt("Copy to clipboard: Ctrl+C or Command+C, Enter", text);
|
|
}
|
|
}
|
|
|
|
function processGraphVizSections(elements) {
|
|
var elements = document.querySelectorAll("[data-viz]");
|
|
var viz = new Viz();
|
|
Array.prototype.forEach.call(elements, function (x) {
|
|
var engine = x.getAttribute("data-viz");
|
|
var image = viz.renderImageElement(x.innerText, {
|
|
format: "png",
|
|
engine: engine
|
|
}).then(function (element) {
|
|
x.parentNode.insertBefore(element, x);
|
|
});
|
|
});
|
|
|
|
|
|
};
|
|
|
|
function updateLanguageParameter(value) {
|
|
const param = "lang";
|
|
|
|
if (window.location.href.indexOf("?") >= 0) {
|
|
const regExp = new RegExp(param + "(.+?)(&|$)", "g");
|
|
const newUrl = window.location.href.replace(regExp, param + "=" + encodeURIComponent(value) + "$2");
|
|
window.history.pushState("", "", newUrl);
|
|
} else {
|
|
const newUrl = window.location.href + "?" + param + "=" + encodeURIComponent(value);
|
|
window.history.pushState("", "", newUrl);
|
|
}
|
|
}
|
|
|
|
function getLanguageParameter() {
|
|
var match = RegExp('[?&]lang=([^&]*)').exec(window.location.search);
|
|
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
|
|
}
|
|
|
|
function docReady() {
|
|
window.gitbook.events.bind("page.change", function () {
|
|
pageChanged();
|
|
});
|
|
}
|
|
|
|
function pageChanged() {
|
|
document.querySelectorAll('.js-copy').forEach(elem => {
|
|
elem.addEventListener("click", function () {
|
|
var el = this;
|
|
var parent = this.parentNode.parentNode;
|
|
var code = parent.querySelector('code');
|
|
var text = code.textContent || code.innerText;
|
|
copyToClipboard(text, el);
|
|
})
|
|
});
|
|
|
|
document.querySelectorAll('.api-lang').forEach(elem => {
|
|
elem.addEventListener("click", function () {
|
|
var curLang = sessionStorage.getItem('nats-api-language');
|
|
var lang = this.getAttribute('data-language');
|
|
|
|
// Stop the infinite loop
|
|
if (curLang == lang) {
|
|
return;
|
|
}
|
|
|
|
sessionStorage.setItem('nats-api-language', lang); // So we only do this 1x
|
|
|
|
updateLanguageParameter(lang)
|
|
|
|
document.querySelectorAll('.api-lang[data-language=' + lang + ']').forEach(elem => {
|
|
elem.click();
|
|
});
|
|
})
|
|
});
|
|
|
|
if (sessionStorage) {
|
|
var curLang = sessionStorage.getItem('nats-api-language');
|
|
var queryLang = getLanguageParameter();
|
|
var lang = curLang;
|
|
|
|
if (queryLang) { // query takes precedent
|
|
lang = queryLang
|
|
}
|
|
|
|
if (lang) {
|
|
document.querySelectorAll('.api-lang[data-language=' + lang + ']').forEach(elem => {
|
|
elem.click();
|
|
});
|
|
}
|
|
}
|
|
|
|
setTimeout(function () {
|
|
processGraphVizSections();
|
|
}, 1);
|
|
}
|
|
|
|
|
|
if (document.readyState != 'loading') docReady();
|
|
else if (document.addEventListener) document.addEventListener('DOMContentLoaded', docReady);
|
|
else document.attachEvent('onreadystatechange', function () {
|
|
if (document.readyState == 'complete') docReady();
|
|
});
|
|
</script>
|
|
|
|
<!-- Github Buttons -->
|
|
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
|
|
|
<!-- Styles -->
|
|
<style>
|
|
div.graphviz {
|
|
background: transparent;
|
|
border: 0;
|
|
padding-top: 15px;
|
|
padding-right: 15px;
|
|
padding-bottom: 15px;
|
|
padding-left: 15px;
|
|
}
|
|
|
|
code[data-viz] {
|
|
display: none;
|
|
}
|
|
|
|
.tab-wrap {
|
|
transition: 0.3s box-shadow ease;
|
|
border-radius: 6px;
|
|
max-width: 100%;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
position: relative;
|
|
list-style: none;
|
|
background-color: #fff;
|
|
margin: 10px 0;
|
|
/* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);*/
|
|
}
|
|
|
|
.tab-wrap:hover {
|
|
box-shadow: 0 12px 23px rgba(0, 0, 0, 0.23), 0 10px 10px rgba(0, 0, 0, 0.19);
|
|
}
|
|
|
|
.tab {
|
|
display: none;
|
|
}
|
|
|
|
/* Using scss these would be generated, we have to manually create enough for all tabs, start with 8 */
|
|
.tab:checked:nth-of-type(1)~.tab__content:nth-of-type(1) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(2)~.tab__content:nth-of-type(2) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(3)~.tab__content:nth-of-type(3) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(4)~.tab__content:nth-of-type(4) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(5)~.tab__content:nth-of-type(5) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(6)~.tab__content:nth-of-type(6) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(7)~.tab__content:nth-of-type(7) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(8)~.tab__content:nth-of-type(8) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:first-of-type:not(:last-of-type)+label {
|
|
border-top-right-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
}
|
|
|
|
.tab:not(:first-of-type):not(:last-of-type)+label {
|
|
border-radius: 0;
|
|
}
|
|
|
|
.tab:last-of-type:not(:first-of-type)+label {
|
|
border-top-left-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
}
|
|
|
|
.tab:checked+label {
|
|
background-color: #fff;
|
|
box-shadow: 0 -1px 0 #fff inset;
|
|
cursor: default;
|
|
font-weight: bold;
|
|
border: 1px solid #ddd;
|
|
border-bottom-color: transparent;
|
|
}
|
|
|
|
.tab:checked+label:hover {
|
|
box-shadow: 0 -1px 0 #fff inset;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.tab+label {
|
|
box-shadow: 0 -1px 0 #eee inset;
|
|
border-radius: 6px 6px 0 0;
|
|
cursor: pointer;
|
|
display: block;
|
|
text-decoration: none;
|
|
color: #27aae1;
|
|
flex-grow: 3;
|
|
text-align: center;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
text-align: center;
|
|
transition: 0.3s background-color ease, 0.3s box-shadow ease;
|
|
height: 50px;
|
|
box-sizing: border-box;
|
|
padding: 15px;
|
|
}
|
|
|
|
.tab+label:hover {
|
|
background-color: #f9f9f9;
|
|
box-shadow: 0 1px 0 #f4f4f4 inset;
|
|
}
|
|
|
|
.tab__content {
|
|
padding: 2px 2px;
|
|
background-color: transparent;
|
|
position: absolute;
|
|
width: 100%;
|
|
z-index: -1;
|
|
opacity: 0;
|
|
left: 0;
|
|
-webkit-transform: translateY(-3px);
|
|
transform: translateY(-3px);
|
|
border-radius: 6px;
|
|
}
|
|
|
|
.tab__content pre {
|
|
margin-bottom: 0px !important;
|
|
}
|
|
|
|
.toolbar-icons {
|
|
display: inline-block;
|
|
position: relative;
|
|
padding-left: 4px;
|
|
}
|
|
|
|
a.toolbar-icons {
|
|
text-decoration: none;
|
|
}
|
|
|
|
.toolbar-icons .mdi {
|
|
color: #4183c4;
|
|
}
|
|
|
|
.copy-msg {
|
|
color: #4183c4;
|
|
}
|
|
|
|
.pull-right {
|
|
float: right !important;
|
|
}
|
|
|
|
.pull-left {
|
|
float: left !important;
|
|
}
|
|
</style>
|
|
|
|
|
|
<script src="gitbook/gitbook.js"></script>
|
|
<script src="gitbook/theme.js"></script>
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
|
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-search/search.js"></script>
|
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
|
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
|
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
|
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|