3 ms·
A message broker works here when you want async behaviour but you are integrating with sync code. To use your REST example, you receive the call, send a message
by cgh 7y ago
A message broker works here when you want async behaviour but you are integrating with sync code. To use your REST example, you receive the call, send a message to DoSomething and then immediately return http 202, perhaps with some id the ui can poll on (if required). Meanwhile, the DoSomething message queue is serviced by a few threads.
- dev_dull 7y agoThat works but it’s an uncommon pattern. Most people prefer to wait in my opinion. I single DB worker doing batch updates would probably be enough.