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

Refactoring Retry Logic for Exponential Retries #138

Merged
merged 18 commits into from
Jan 9, 2020

Conversation

mjayprateek
Copy link
Contributor

@mjayprateek mjayprateek commented Jan 3, 2020

  • Introduces retry types [:linear, :exponential]
  • Removed the usage of retry-limits in case of exponential retries
  • Introduces queue-timeout-ms for channels

(let [{:keys [queue-name exchange-name dead-letter-exchange]} (:delay (rabbitmq-config))
queue-name (delay-queue-name topic-entity queue-name)
exchange-name (prefixed-queue-name topic-entity exchange-name)
dead-letter-exchange-name (prefixed-queue-name topic-entity dead-letter-exchange)
sequence (if (<= retry-count exponential-backoff-count) (inc retry-count) (inc exponential-backoff-count))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exponential-backoff-count also used to control if we want to have exponential retry initially but after some retry it will be linear retry. how we can achieve it now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're not supporting that anymore, I cannot think of a usecase where we'll need both linear and exponential retry in the same flow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, it unnecessarily complicates things.

@theanirudhvyas theanirudhvyas merged commit 4dc8523 into gojek:master Jan 9, 2020
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

3 participants