Explore NATS Queueing
Prerequisites
1. Start the NATS server
nats-server2. Clone the repositories for each client examples
go get github.com/nats-io/nats.go
git clone https://github.com/nats-io/nats.js.git
git clone https://github.com/nats-io/nats.rb.git3. Run the Go client subscriber, providing a queue group name
cd $GOPATH/src/github.com/nats-io/nats.go/examples
go run nats-qsub/main.go foo my-queue4. Install and run the Node client subscriber with queue group name
npm install nats
cd nats.js/examples
node node-sub --queue=my-queue foo5. Install and run the Ruby client subscriber with queue group name
6. Run another Go client subscriber without the queue group.
7. Publish a NATS message using the Go client
8. Verify message publication and receipt
9. Publish another message
最后更新于