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 2022/07/14 03:29:01 UTC

[GitHub] [rocketmq] vergilyn commented on issue #4602: Support fetch All consumerExecutor's. (by ConsumeMessageOrderlyService or ConsumeMessageConcurrentlyService create.)

vergilyn commented on issue #4602:
URL: https://github.com/apache/rocketmq/issues/4602#issuecomment-1183942894

   
   @lizhiboo sorry, I understood the confusion before.
   
   I want to have been `awaitterminationmswhenshutdown` implementation, as long as `awaitterminationmswhenshutdown` set is long enough. 
   
   ```JAVA
       public static void shutdownGracefully(ExecutorService executor, long timeout, TimeUnit timeUnit) {
           // Disable new tasks from being submitted.
           executor.shutdown();
           try {
               // Wait a while for existing tasks to terminate.
               if (!executor.awaitTermination(timeout, timeUnit)) {
                   executor.shutdownNow();
                   // Wait a while for tasks to respond to being cancelled.
                   if (!executor.awaitTermination(timeout, timeUnit)) {
                       log.warn(String.format("%s didn't terminate!", executor));
                   }
               }
           } catch (InterruptedException ie) {
               // (Re-)Cancel if current thread also interrupted.
               executor.shutdownNow();
               // Preserve interrupt status.
               Thread.currentThread().interrupt();
           }
       }
   ```


-- 
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