Closed
Description
The consumption logic could be made even simpler and at the same time more performant (still to be proved) cuz there would be fewer round trips, fewer locks.
- The first select returns an array of 100 message ids. No transaction, no pessimistic lock.
- Then we walk through the array and try to catch one free message. We can do it with an `UPDATE ... SET deliveryId=ourUniqueId WHERE id=currentMessageId AND deliveryId IS NULL.
- Check whether we succeeded in previous step or not