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

[ISSUE #8062] feat: Add virtual thread support for consumers #8063

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

He-Pin
Copy link
Member

@He-Pin He-Pin commented Apr 24, 2024

Which Issue(s) This PR Fixes

Fixes #8062

Brief Description

  1. Add config for preferring the virtual thread, "rocketmq.client.consumer.virtualThread" default to false
  2. When config is true and the Virtual thread is enabled, Make use of the virtual thread.

How Did You Test This Change?

with unit tests

@He-Pin He-Pin force-pushed the vtSupport branch 4 times, most recently from 3d12a39 to 9006d53 Compare April 24, 2024 13:25
@He-Pin He-Pin mentioned this pull request Apr 24, 2024
this.consumeExecutor = new ThreadPoolExecutor(
this.defaultMQPushConsumer.getConsumeThreadMin(),
this.defaultMQPushConsumer.getConsumeThreadMax(),
1000 * 60,
TimeUnit.MILLISECONDS,
this.consumeRequestQueue,
new ThreadFactoryImpl("ConsumeMessageThread_" + consumerGroupTag));
new ThreadFactoryImpl(threadNamePrefix, false, null, PREFER_VIRTUAL));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not using the one task one executor pattern for Virtual Thread, this works well too, otherwise, needs much adoption.

@cserwen cserwen changed the title feat: Add virtual thread support for consumers. [ISSUE #8062] feat: Add virtual thread support for consumers Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement Request[Enhancement] Virtual thread support for consumer thread
1 participant