Closed JMTamayo closed 4 months ago
Why not use xautoclaim, and instead do the double round trip to the server with xpending and xclaim with the extra "is mine" check? Particularly because the check for ownership in the server should be done as near as possible to the moment of actual processing.
XAUTOCLAIM is not implemented in redis v0.25.3, so, I implemented XPENDING and XCLAIM to claim pending messages from another consumers according to the consumer configuration.
Why not use xautoclaim, and instead do the double round trip to the server with xpending and xclaim with the extra "is mine" check? Particularly because the check for ownership in the server should be done as near as possible to the moment of actual processing.
The claim_pending_messages function was modified to implement the combination of XPENDING + XCLAIM without the "it is not mine" validation that previously existed. The objective is to minimize the time between the XPENDING response and the request with XCLAIM as much as possible.
Currently, XAUTOCLAIM is not supported by redis-rs, however, I will manage its implementation with the project contributors. When this development is ready, we proceed to implement it in redsumer.
Please take a look at last changes in this PR. Thanks.
Important comments for reviewing the PR:
Thanks for your review 👍