nsq Documentation

A realtime distributed messaging platform

25,775 stars Go Go 1 file ยท ~1,490 tokens #distributed-systems#go#message-queue#messaging#nsq#queue
RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy nsq on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name nsq -p 4150:4150 --restart always nsqio/nsq:latest

File: README.md

NSQ is a realtime distributed messaging platform designed to operate at scale, handling
billions of messages per day.

It promotes distributed and decentralized topologies without single points of failure,
enabling fault tolerance and high availability coupled with a reliable message delivery
guarantee. See features & guarantees.

Operationally, NSQ is easy to configure and deploy (all parameters are specified on the command
line and compiled binaries have no runtime dependencies). For maximum flexibility, it is agnostic to
data format (messages can be JSON, MsgPack, Protocol Buffers, or anything else). Official Go and
Python libraries are available out of the box (as well as many other client
libraries
), and if you're interested in building your own, there's a protocol
spec
.

We publish binary releases for Linux, Darwin, FreeBSD and Windows, as well as an official Docker image.

NOTE: master is our development branch and may not be stable at all times.

In Production

  
  
  
  
  

  
  
  
  
  

  
  
  
  
  

  
  
  
  
  

  
  
  
  
  

  
  
  

Code of Conduct

Help us keep NSQ open and inclusive. Please read and follow our Code of Conduct.

Authors

NSQ was designed and developed by Matt Reiferson (@imsnakes) and Jehiah Czebotar
(@jehiah) but wouldn't have been possible without the support of Bitly,
maintainers (Pierce Lopez), and all our contributors.

Logo created by Wolasi Konu (@kisalow).


File: apps/to_nsq/README.md

to_nsq

A tool for publishing to an nsq topic with data from stdin.

Usage

text
Usage of ./to_nsq:
  -delimiter string
    	character to split input from stdin (default "\n")
  -nsqd-tcp-address value
    	destination nsqd TCP address (may be given multiple times)
  -producer-opt value
    	option to passthrough to nsq.Producer (may be given multiple times, http://godoc.org/github.com/nsqio/go-nsq#Config)
  -rate int
    	Throttle messages to n/second. 0 to disable
  -topic string
    	NSQ topic to publish to

Examples

Publish each line of a file:

bash
$ cat source.txt | to_nsq -topic="topic" -nsqd-tcp-address="127.0.0.1:4150"

Publish three messages, in one go:

bash
$ echo "one,two,three" | to_nsq -delimiter="," -topic="topic" -nsqd-tcp-address="127.0.0.1:4150"

File: apps/nsqlookupd/README.md

nsqlookupd

nsqlookupd is the daemon that manages topology metadata and serves client requests to
discover the location of topics at runtime.

Read the docs.


File: apps/nsqd/README.md

nsqd

nsqd is the daemon that receives, queues, and delivers messages to clients.

Read the docs.


File: nsqadmin/README.md

nsqadmin

nsqadmin is a Web UI to view aggregated cluster stats in realtime and perform various
administrative tasks.

Read the docs

Local Development

Dependencies

  1. Install NodeJS 16.x (includes npm)

Live Reload Workflow

  1. $ npm install
  2. $ ./gulp --series clean watch
  3. $ cd .. && make && ./build/nsqadmin --dev-static-dir=nsqadmin/static/build --lookupd-http-address=<...>
  4. make changes to static assets (repeat step 3 only if you make changes to any Go code)

Build

  1. $ ./gulp --series clean build

File: nsqd/README.md

nsqd

nsqd is the daemon that receives, queues, and delivers messages to clients.

Read the docs


File: nsqlookupd/README.md

nsqlookupd

nsqlookupd is the daemon that manages topology metadata and serves client requests to
discover the location of topics at runtime.

Read the docs