Github user zhouxinyu commented on a diff in the pull request:
https://github.com/apache/incubator-rocketmq/pull/64#discussion_r101718137
--- Diff:
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageConcurrentlyService.java
---
@@ -93,8 +93,24 @@ public void run() {
}
public void shutdown() {
+ shutdown(0);
+ }
+
+ @Override
+ public void shutdown(long awaitTerminateMillis) {
this.scheduledExecutorService.shutdown();
this.consumeExecutor.shutdown();
+ //await to consume
+ if (awaitTerminateMillis > 0) {
+ try {
+
this.consumeExecutor.awaitTermination(awaitTerminateMillis,TimeUnit.MILLISECONDS);
+ if (!this.consumeExecutor.isTerminated()) log.info("There
are messages still being consumed in thread pool, but not going to await them
anymore. Have awaited for {} ms",awaitTerminateMillis);
--- End diff --
Did you follow our code code guidelines[1] ? Below `if` block is
recommended.
```
if {
}
```
http://rocketmq.incubator.apache.org/docs/code-guidelines/
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---