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

[Java Client] Improve consumer listener logic #13273

Conversation

michaeljmarshall
Copy link
Member

Motivation

In #13023, we updated the Java client's consumer listener logic to ensure correct ordering of messages received. We can simplify the logic for the variable named executorQueueSize. It can be volatile instead of atomic and it can be a boolean instead of an integer.

Modifications

  • Rename executorQueueSize to isListenerHandlingMessage in ConsumerBase and make it volatile instead of Atomic
  • Remove unnecessary scheduling on internalPinnedExecutor in ConsumerImpl

Verifying this change

This is a trivial change.

Does this pull request potentially affect one of the following parts:

This is not a breaking change.

Documentation

  • no-need-doc

This is an internal change.

@michaeljmarshall michaeljmarshall added area/client type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use labels Dec 13, 2021
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 13, 2021
@codelipenghui codelipenghui added this to the 2.10.0 milestone Dec 14, 2021
@michaeljmarshall michaeljmarshall merged commit 9f46c4a into apache:master Dec 21, 2021
@michaeljmarshall michaeljmarshall deleted the improve-consumer-listener-logic branch December 21, 2021 21:17
codelipenghui pushed a commit that referenced this pull request Dec 22, 2021
* [Java Client] Improve consumer listener logic

* Move isListenerHandlingMessage update to before submitting to executor

(cherry picked from commit 9f46c4a)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Dec 22, 2021
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Dec 29, 2021
* [Java Client] Improve consumer listener logic

* Move isListenerHandlingMessage update to before submitting to executor
michaeljmarshall added a commit that referenced this pull request Mar 30, 2022
* [Java Client] Improve consumer listener logic

* Move isListenerHandlingMessage update to before submitting to executor

(cherry picked from commit 9f46c4a)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Mar 30, 2022
* [Java Client] Improve consumer listener logic

* Move isListenerHandlingMessage update to before submitting to executor

(cherry picked from commit 9f46c4a)
(cherry picked from commit f82a7a6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.4 release/2.9.2 type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants