DEV Community

Discussion on: NSQ Tutorial: Build a simple message queue using NSQ

Collapse
vguleaev profile image
Vladislav Guleaev Author

And what do you mean by that?

Collapse
vithabada profile image
Vít Habada

Mentioned use case includes service integration, which should have much higher resilience requirements for a messaging system.

Producer wants/needs guarantee when publishing a message, that the message will be eventually received (which is not the case given the NSQ architecture).

Two quoted statements are in contradiction since publisher can receive ACK from NSQ and message might not propagate further due to node failure (that is not 'at least once').

More on durability - NSQ seems to be latency/throughput optimized and keeps messages in memory instead of using write-ahead log or quorums (both significantly increase latency), so even when node recovers from failure, the message might be lost.

Thread Thread
janbaer profile image
Jan Baer

You can configure NSQ with a starting parameter to persists every message to disk and not keep them only in memory. So it's guaranteed that no message is going lost when the system crashes or will be rebooted before the message will be delivered to the consumers.