-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 pending-blocked-message-permits to dispatcher while redelivery of pending messages #63
Conversation
CLA is valid! |
2 similar comments
CLA is valid! |
CLA is valid! |
2ed98fd
to
79073b8
Compare
79073b8
to
0e40e95
Compare
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.
Just some minor stuff, else the change looks good
// dispatch pending permits to flow more messages: it will add more permits to dispatcher and consumer | ||
subscription.consumerFlow(consumer, additionalNumberOfPermits); | ||
// add newly flow permits to actual consumer.messagePermits | ||
consumer.messagePermits.getAndAdd(additionalNumberOfPermits); |
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.
We should update the messagePermits
before sending the flow just to be consistent
subscription.consumerFlow(this, additionalNumberOfMessages); | ||
}else { |
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.
minor formatting
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.
addressed both the comments.. thanks.
0e40e95
to
1468f6d
Compare
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.
👍
@merlimat could you take a look at this change?
Looks good, but wanted to check it with fresh eyes tomorrow |
1468f6d
to
b07112b
Compare
@merlimat : addressed renaming changes. |
…f pending messages
b07112b
to
d9ca1f7
Compare
Fixes apache#63 *Movitation* Migrate the jenkins to the Github Action.
Motivation
When Consumer is blocked due to not acking max-unack_threshold messages: Consumer keeps adding flow-permits to
messagePermits
and doesn't sends it toDispatcher
until consumer gets unblocked again.In Mean time, if
redelivery
requests comes thenDispatcher
doesn't send additional number of messages for permits which came after consumer was blocked.(1) messagePermit before consumer blocked
(2) messagePermit after consumer blocked.
So, when consumer receives redelivery request: it can redeliver number of blocked-permit messages in message-replay.
Modifications
Introduce two message permit counts to support redelivery of messages when consumer is blocked and client-consumer actually has more permits to receive more messages.
Result
It delivers messages on
redelivery-message
request by also considering permits which comes after consumer got blocked due to reaching unack-message-threshold.