I've used NSQ for one of our projects - It is very cool system for handling messaging queues. But I had a very annoying problem - We have more than 5 queues and for each I should start new container of nsq_tail:
version: '3.2' services: nsqtail: image: nsqio/nsq command: /nsq_tail --topic=mytopic1 --lookupd-http-address=nsqlookupd:4161 nsqtail2: image: nsqio/nsq command: /nsq_tail --topic=mytopic2 --lookupd-http-address=nsqlookupd:4161 nsqtail3: image: nsqio/nsq command: /nsq_tail --topic=mytopic3 --lookupd-http-address=nsqlookupd:4161 ...
I know that Docker is "lightweight" system... But not lightweight-enough for running too many containers for simple tasks. So my idea was to make nsq_tail listen for multiple topics at once and write all messages from them. Now I can do simply:
And then in logs I see: