NATS Messaging

{{Short description|Distributed messaging software}}

{{Infobox software

| title = NATS

| name = NATS

| logo = NATS-logo.png

| screenshot =

| caption =

| developer = [https://www.cncf.io/projects/nats/ Cloud Native Computing Foundation]

| latest release version = [https://github.com/nats-io/nats-server/releases 2.11.4]

| latest release date = {{Start date and age|2025|05|22}}

| released = 2011 {{Cite web|url=https://github.com/nats-io/nats.rb/releases/tag/v0.3.12|title = Release v0.3.12 · nats-io/Nats.rb|website = GitHub}}

| programming language = Go

| operating system = Cross-platform

| genre = Message broker, message-oriented middleware

| license = Apache 2.0

| repo = {{URL|https://github.com/nats-io/nats-server}}

| website = {{URL|https://www.nats.io/}}

}}

NATS is an open-source messaging system (sometimes called message-oriented middleware). The NATS server is written in the Go programming language. Client libraries to interface with the server are available for dozens of major programming languages. The core design principles of NATS are performance, scalability, and ease of use.{{Cite web | url=https://docs.nats.io | title=NATS Documentation}} The acronym NATS stands for Neural Autonomic Transport System.{{Cite web | url=https://docs.nats.io/reference/faq#what-does-the-nats-acronym-stand-for | title=NATS FAQ}}

NATS is an open source project under the stewardship of CNCF. NATS was originally developed by [https://twitter.com/derekcollison Derek Collison] as the messaging control plane for Cloud Foundry and was written in Ruby. NATS was later ported to Go.

The source code is released under the Apache 2.0 License. NATS consists of:

  • The [https://github.com/nats-io/nats-server/ NATS Server] - The core Publish-Subscribe Server for NATS.
  • [https://nats.io/download/ Client libraries] for a variety of programming languages.
  • A [https://github.com/nats-io/nats-connector-framework connector framework] - a pluggable Java based framework to connect NATS and other services. NATS is a CNCF project with Kubernetes and Prometheus integration.{{cite web | title=What's New in NATS 2.2| url=https://docs.nats.io/whats_new_22}}

The NATS server is often referred to as either 'Core NATS' or NATS with 'JetStream'.

'Core NATS' is the set of core NATS functionalities and qualities of service.

'JetStream' is the (optionally enabled) built-in persistence layer that adds streaming, queues, at-least-once and exactly-once delivery guarantees, historical data replay, decoupled flow-control and key/value store functionalities to Core NATS. JetStream replaced the old STAN (NATS Streaming) approach.{{Cite web | url=https://docs.nats.io/nats-concepts/jetstream | title=NATS JetStream}}

Example

Below is a sample connection string from a telnet connection to the demo.nats.io site:{{cite web|title=NATS Protocol|url=https://docs.nats.io/nats-protocol/nats-protocol-demo|website=NATS Documentation|accessdate=6 May 2016}}

Trying 107.170.221.32...

Connected to demo.nats.io.

Escape character is '^]'.

INFO {"server_id":"NBQTR375TCWD25CA7L7IMNPFHKE6HO2LUPUMVTHDZ4EAMZW22VKRJZIU","server_name":"us-south-nats-demo","version":"2.11.2","proto":1,"git_commit":"55efd1d","go":"go1.24.2","host":"0.0.0.0","port":4222,"headers":true,"tls_available":true,"max_payload":1048576,"jetstream":true,"client_id":11140,"client_ip":"2605:a601:a0ea:9400:8d63:878c:f3c7:5f1d","nonce":"-POYlpCo67Il2tE","xkey":"XDBV256WPGRKANJATV6Y56FBBDFHY7UCEX7CXXUI47N7Y4SS2HJVPS2Q"}

References

{{reflist}}

See also

=Further reading=

  • {{cite web|last1=Aslam|first1=Asim|title=Micro on NATS - Microservices with Messaging|url=https://blog.micro.mu/2016/04/11/micro-on-nats.html |archive-url=https://web.archive.org/web/20160422011408/https://blog.micro.mu/2016/04/11/micro-on-nats.html |archive-date=2016-04-22 |website=Micro Blog|accessdate=6 May 2016}}
  • {{cite news|last1=Werthheim|first1=Daniel|title=NATS - What a beautiful protocol|newspaper=Danielwertheim |url=http://danielwertheim.se/nats-what-a-beautiful-protocol/|accessdate=4 May 2016|date=2016-04-27}}
  • {{cite web|last1=Riggins|first1=Jennifer|title=How NATS, a REST Alternative, Provides Messaging for Distributed Systems|url=http://thenewstack.io/nats-rest-alternative-provides-messaging-distributed-systems/|website=TheNewStack|accessdate=6 May 2016|date=2015-12-15}}
  • {{cite web|last1=Monteiro|first1=Diogo|title=Using NATS instead of HTTP for inter service communication|url=http://www.diogogmt.com/2016/02/08/benchmarking-nats-and-rest/ |archive-url=https://web.archive.org/web/20180717093843/www.diogogmt.com/2016/02/08/benchmarking-nats-and-rest/ |archive-date=2018-07-17 |website=Diogo GMT|accessdate=2 May 2016}}
  • {{cite web|last1=Sohlich|first1=Radomir|title=NATS to REST Proxy|url=http://nats.io/blog/natsproxy_project/|website=NATS Blog|date=23 April 2016|accessdate=1 May 2016}}
  • {{cite web|last1=Gracely|first1=Brian|last2=Delp|first2=Aaron|title=NATS - Cloud Native Infrastructure|url=http://www.thecloudcast.net/2015/12/the-cloudcast-233-nats-cloud-native.html|website=The CloudCast|accessdate=23 December 2015}}
  • {{cite web|title=A signaling system for 10M+ concurrent connections|url=http://blog.greta.io/a-webrtc-signaling-system-that-scales-very-effectively/|website=Greta.io|publisher=Greta|accessdate=6 May 2016|date=2016-03-21}}
  • {{cite web|last1=Treat|first1=Tyler|title=Benchmarking Message Queue Latency|url=http://bravenewgeek.com/tag/message-queues/|website=Brave New Geek|date=28 April 2020 }}
  • {{cite web|last1=Fulton III|first1=Scott|title=NATS Moves to Real-time Message Streaming with Persistence|url=http://thenewstack.io/apcera-nats-moves-real-time-message-stream-brokering/|website=The New Stack|accessdate=19 July 2016|date=2016-07-18}}
  • {{cite web|title=Protecting NATS and the integrity of open source|url=https://www.cncf.io/blog/2025/04/24/protecting-nats-and-the-integrity-of-open-source-cncfs-commitment-to-the-community/|website=CNCF|accessdate=25 April 2025|date=2025-04-24}}

{{Message-oriented middleware}}

Category:Free software programmed in Go

Category:Message-oriented middleware

Category:Cloud infrastructure

Category:Free software for cloud computing

Category:Service-oriented architecture-related products

Category:Enterprise application integration

Category:Cross-platform free software

Category:Software using the Apache license