Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[dbal] consumption improvements. #605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
makasim opened this issue Nov 1, 2018 · 0 comments · Fixed by #613
Closed

[dbal] consumption improvements. #605

makasim opened this issue Nov 1, 2018 · 0 comments · Fixed by #613

Comments

@makasim
Copy link
Member

makasim commented Nov 1, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant