He-Pin commented on code in PR #8063:
URL: https://github.com/apache/rocketmq/pull/8063#discussion_r1578935562
##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageConcurrentlyService.java:
##########
@@ -70,13 +72,14 @@ public
ConsumeMessageConcurrentlyService(DefaultMQPushConsumerImpl defaultMQPush
this.consumeRequestQueue = new LinkedBlockingQueue<>();
String consumerGroupTag = (consumerGroup.length() > 100 ?
consumerGroup.substring(0, 100) : consumerGroup) + "_";
+ final String threadNamePrefix = "ConsumeMessageThread_" +
consumerGroupTag;
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));
Review Comment:
This is not using the one task one executor pattern for Virtual Thread, this
works well too, otherwise, needs much adoption.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]