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

[Enhancement][Consumer] Parallel Execution of Interceptors in beforeConsume Method #23569

Open
2 tasks done
ZhaoGuorui666 opened this issue Nov 6, 2024 · 1 comment
Open
2 tasks done
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Comments

@ZhaoGuorui666
Copy link
Contributor

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Currently, the beforeConsume method in ConsumerInterceptors.java executes each interceptor sequentially. Since the interceptors operate independently without dependencies on one another, introducing parallel execution can potentially improve performance.

image

Solution

No response

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@ZhaoGuorui666 ZhaoGuorui666 added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Nov 6, 2024
@visxu
Copy link
Contributor

visxu commented Nov 7, 2024

Good suggestion. However I have another word, sometimes you need multiple interceptors are executed in extremely order.
Maybe you can add a new boolean parameter requireOrder flag to determine whether to execute interceptors in order or parallel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

No branches or pull requests

2 participants