-
Notifications
You must be signed in to change notification settings - Fork 64
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
add channel custom delay #80
Conversation
86661ec
to
6da0a41
Compare
@thediantoni are you working on this? |
@theanirudhvyas yes, we are still thinking to add exponential backoff as well |
ffacdad
to
e53cfdf
Compare
src/ziggurat/messaging/producer.clj
Outdated
|
||
(defn- channel-retries-exponential-backoff-enabled [topic-entity channel] | ||
(-> (ziggurat-config) :stream-router topic-entity :channels channel :retry :exponential-backoff-enabled)) | ||
|
||
(defn publish-to-channel-delay-queue [topic-entity channel message] | ||
(let [{:keys [exchange-name queue-timeout-ms]} (:delay (rabbitmq-config)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thediantoni A doc-string will help here. Somewhere we need to explain the new configs which have been introduced - channel delay/exponential backoff/channel specific queue timeout.
This doc-string can help with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc-string added @mjayprateek
(let [message-from-mq (rmq/get-msg-from-channel-dead-queue topic-entity channel)] | ||
(is (= expected-message message-from-mq)))))) | ||
|
||
(testing "message in channel will be retried with exponential queue timeout" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thediantoni how are we testing that exponential back-off was used? We're not measuring time taken anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @mjayprateek , extracted the logic to get-queue-timeout-ms and create the test for different queue timeout when exponential backoff is enabled
:channel-exponential-retry #(constantly nil)}} | ||
(let [retry-count (atom 2) | ||
topic-entity :default | ||
channel :channel-exponential-retry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thediantoni testing..
says channel exponential queue timeout
but config.end has defined queue-timeout-ms
for exponential-retry
, not for channel-exponential-retry
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if queue-timeout-ms
not defined for channel-exponential-retry
, it will use timeout config from ziggurat rabbit-mq delay queue-timeout-ms
e53cfdf
to
c81fbc6
Compare
c81fbc6
to
a253745
Compare
This is to add custom delay on channel #78. Please help to review.