You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/09/01 11:45:35 UTC

[GitHub] [rocketmq] ltamber commented on a change in pull request #3287: [ISSUE #3286] replace Timer with ScheduledExecutorService

ltamber commented on a change in pull request #3287:
URL: https://github.com/apache/rocketmq/pull/3287#discussion_r700134830



##########
File path: store/src/main/java/org/apache/rocketmq/store/schedule/ScheduleMessageService.java
##########
@@ -113,7 +115,7 @@ public long computeDeliverTimestamp(final int delayLevel, final long storeTimest
     public void start() {
         if (started.compareAndSet(false, true)) {
             super.load();
-            this.timer = new Timer("ScheduleMessageTimerThread", true);
+            this.scheduledExecutorService = new ScheduledThreadPoolExecutor(32, new DefaultThreadFactory("ScheduleMessageTimerThread"));

Review comment:
       IMO, it would be better if the thread pool core size is configureable or just use `Runtime.getRuntime().availableProcessors()`




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org