On this page
Overview
nats.go is the official Go client for NATS. It provides Core NATS publish/subscribe, request/reply, queue subscriptions, JetStream stream and consumer management, persistent publish/consume, TLS, NKeys and user credentials, and reconnect handling.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Build service messaging with Pub/Sub, request/reply, and queue subscriptions
Core NATS APIs cover publishing, asynchronous and synchronous subscriptions, request/reply, channel subscriptions, and graceful drain behavior over subject-based messaging.
Sources: [2]
Manage persistent streams and consumers with JetStream
The JetStream API exposes stream and consumer handles for persistent publishing, consumption, acknowledgements, and consumer lifecycle control.
Sources: [2]
Best fit
Fits cloud-native backends mixing low-latency Pub/Sub with durable messaging
Core NATS can cover service request/reply and event distribution while JetStream adds replay and durability in the same client ecosystem.
Sources: [2]
Before adoption
v1.54.0 raises the minimum to Go 1.26; regression-test reconnect and consumer behavior
Version 1.54.0 raises the minimum Go version to 1.26 and adds nats-server v2.15 stream and consumer information fields. The release fixes JetStream iterators after reconnects, ordered-consumer message loss and subscription resurrection, plus a Core subscription SID race, so reconnects, drains, pending limits, and ordered consumers need regression coverage.
Official sources
- [1]nats-io/nats.go — GitHub repository(2026-10-06)
- [2]NATS Go Client v1.54.0 — README(2026-10-06)
- [3]NATS Go Client v1.54.0 — go.mod(2026-10-06)
- [4]NATS Go Client v1.54.0 release(2026-10-06)
- [5]NATS Go Client Apache-2.0 license(2026-10-06)
Supplemental curator note
One client covers lightweight Core NATS Pub/Sub and persistent JetStream messaging. Reconnects, draining, subscription pending limits, and JetStream acknowledgements or consumer lifecycles affect message loss and duplicates, so test failure scenarios explicitly.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/nats-io/nats.go.git - 2
Enter the repository
cd nats.go - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
6,770 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 25
- Open PRs
- 46
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- go
- golang
- nats
- microservices
- microservices-architecture
- pub-sub
- cloud-native
- cloud-native-architectures
- cloud-native-microservices
- Stars
- 6,770
- Forks
- 839
- Watchers
- 155
- Open issues
- 120
- Contributors
- 156
- Owner type
- Organization
- Primary language
- Go
- License
- Apache-2.0
- Repository last updated
- Oct 6, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Echo32,754 Stars
2 shared tag(s) · Same language
A Go web framework that adds routing, middleware, binding, and error handling around net/http
Go - gobreaker3,702 Stars
3 shared tag(s) · 2 shared category(s) · Same language
stop sending requests to a failing dependency with open, half-open, and closed circuit states
Go - Istio38,429 Stars
3 shared tag(s) · 1 shared category(s) · Same language
add mTLS, traffic policy, and telemetry transparently between services
Go - Asynq13,748 Stars
3 shared tag(s) · 1 shared category(s) · Same language
distribute background tasks to Redis-backed worker queues with retries and scheduling
Go - Sarama12,523 Stars
3 shared tag(s) · 1 shared category(s) · Same language
cover Kafka producers, consumer groups, administration, and transactions from Go
Go - kafka-go8,638 Stars
3 shared tag(s) · 1 shared category(s) · Same language
use high-level Reader and Writer APIs or drop down to a low-level pure-Go Kafka connection
Go
Report incorrect information
Tell us if any listing information is incorrect or outdated.