1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00
Matthias Hanel bf9b8a8247 Reworded to describe behaviour of non java clients and merge examples.
Specifically removed the reference to flush which is not influenced by
this setting.
Merged the examples as both values together make more sense.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-02-05 18:16:27 -05:00
..
2019-12-18 22:09:45 +00:00
2019-12-05 14:11:07 -06:00
2019-12-18 22:09:45 +00:00

Connecting

A NATS system is usually identified by a standard URL with the nats or tls protocol, e.g. nats://demo.nats.io. A NATS system can be a single server, a small cluster or a global super cluster. Throughout these examples we will rely on a single test server, provided by nats.io, at nats://demo.nats.io, where 4222 is the default port for NATS.

NATS also supports secure connectivity using TLS via the tls protocol. Most clients support auto-detection of a secure connection using the URL protocol tls. There is also a demo server running TLS at tls://demo.nats.io:4443. The protocol requirement is being made optional for many client libraries, so that you can use demo.nats.io:4222 as the URL and let the client and server resolve whether or not TLS is required.

There are numerous options for a NATS connection ranging from timeouts to reconnect settings.