The Minimum You Need To Know About @nsqio – a realtime distributed messaging platform (and written in Go)

TL;DR       nsqd <——> nsqlookupd <——> nsq clients

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

  • processes messages produced by nsq clients
  • registers itself to nsqlookupd
  • by default, listens on port 4150 (for TCP clients), 4151 (for HTTP clients)
  • receives messages
  • queue and re-queue messages
  • broadcast topics and channels to nsqlookupd

nsqlookupd – the daemon that manages topology information.

  • clients query nsqlookupd to discover nsqd producers for a specific topic information
  • by default, listens on port 4160 (for TCP clients), 4161 (for HTTP clients)
  • must have static IP address as much as possible
  • no need for etcd, Consul or Zookeeper
  • must be run in the same machine (physical or virtual) as nsqd

nsq clients

  • HTTP – nsqd has a built-in Web server (as of this moment, uses httprouter)
  • clients written in Go, Python, JavaScript have official client libraries
  • registers itself to nsqlookupd (for scalability)
  • clients are apps that produce or consume messages (can be both at the same time) to and from nsqd

Of course, there is nsqadmin and some utilities but the above-mentioned information is the minimum you need to know about NSQ

With the advent of Docker 1.12 in swarm mode, getting NSQ cluster up and running is made easier and more robust, made possible by ideas from Borg and Kubernetes from Google.

For Go examples using NSQ, visit my GitHub repo at


Subjectivity aside, leave a reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s