Skip to content
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

Rudimentary retry support through xautoclaim #1

Merged
merged 4 commits into from
Jul 13, 2021
Merged

Conversation

alexmreis
Copy link
Contributor

@alexmreis alexmreis commented Jul 13, 2021

Description

Currently, nagare does not implement any retry logic. Messages that do not get ACKed by their original consumer remain on the pending list forever.

This PR introduces retries through using the XAUTOCLAIM command introduced in Redis 6.2. The logic is as follows:

  • Try to retrieve the next pending message through XAUTOCLAIM that is idle for more than Nagare::Config.min_idle_time ms
  • If any messages are retrieved this way, don't poll the stream, and processed the claimed message
  • If there aren't any pending messages, process the next one on the stream

Not implemented yet

  • Dead Letter Queue - Ideally, before or after retrying, nagare would look at the retry count of a certain message and move it to the DLQ instead of retrying after Nagare::Config.max_retries has been reached.

Caveats

After merging this PR, Nagare will REQUIRE Redis 6.2. Any older versions will not work, including Google Cloud's and Amazon's Redis-compatible caching solutions.

The redis-rb gem still needs quite a bit of work before being able to release version 6.2, see redis/redis-rb#978

@alexmreis alexmreis merged commit 16e194b into master Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant