-
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
[Java Client] Disable batch receive timer for Readers #8381
[Java Client] Disable batch receive timer for Readers #8381
Conversation
- since the Reader implementation doesn't use the batch receiving functionality, it's more efficient to set the timeout to 0 of the BatchReceivePolicy of the internal consumer of the Reader implementation - this disables the timer that would get called every 100ms by default just for nothing
/pulsarbot run-failure-checks |
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.
👍 Also for consumers, it would be better if the timer gets started only the first time someone tries to do a batch receive.
/pulsarbot run-failure-checks |
@wolfstudy this change should be included in 2.6.2. |
Sure, will do it. |
- since the Reader implementation doesn't use the batch receiving functionality, it's more efficient to set the timeout to 0 of the BatchReceivePolicy of the internal consumer of the Reader implementation - this disables the timer that would get called every 100ms by default just for nothing (cherry picked from commit eea86a5)
- since the Reader implementation doesn't use the batch receiving functionality, it's more efficient to set the timeout to 0 of the BatchReceivePolicy of the internal consumer of the Reader implementation - this disables the timer that would get called every 100ms by default just for nothing
- since the Reader implementation doesn't use the batch receiving functionality, it's more efficient to set the timeout to 0 of the BatchReceivePolicy of the internal consumer of the Reader implementation - this disables the timer that would get called every 100ms by default just for nothing
Motivation
In the current implementation, each Reader implementation wraps a Consumer implementation.
By default, the consumer implementation will use a BatchReceivePolicy that triggers a task every 100 milliseconds.
Since the Reader implementation doesn't use the batch receiving functionality, it's more efficient to disable the timer.
Modifications
The the timeout is set to 0 for BatchReceivePolicy used for internal consumer of the Reader implementation.
This disables the timer that would get called every 100ms by default just for nothing.