Skip to content

Comment on How far can you go without a message queue?

Comments

Off-topic: in the order book updates example, the top of the book is updated using one field per message:

echo '{ "symbol": "AAPL", "bidPrice": 174.1 }' | rpk topic produce book-updates echo '{ "symbol": "AAPL", "bidVolume": 1000 }' | rpk topic produce book-updates echo '{ "symbol": "AAPL", "askPrice": 174.2 }' | rpk topic produce book-updates echo '{ "symbol": "AAPL", "askVolume": 2000 }' | rpk topic produce book-updates echo '{ "symbol": "AAPL", "bidPrice": 174.0 }' | rpk topic produce book-updates

However some top of the book update can result in an entire level disappearing. In that case, both price and volume changed actually at the same time, yet according to this example it will be broken down into two messages? This will lead to inconsistent state of the book when I read it between two messages. Or did the example just happen to show one field per message, and multiple fields per message are possible too?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.