You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/04/06 13:21:05 UTC

[GitHub] [skywalking] sonatype-lift[bot] commented on a diff in pull request #8827: Add kafka consumers number default = 1,enhance consumption capacity

sonatype-lift[bot] commented on code in PR #8827:
URL: https://github.com/apache/skywalking/pull/8827#discussion_r843941953


##########
oap-server/server-fetcher-plugin/kafka-fetcher-plugin/src/main/java/org/apache/skywalking/oap/server/analyzer/agent/kafka/KafkaFetcherHandlerRegister.java:
##########
@@ -106,25 +113,28 @@ public void register(KafkaHandler handler) {
 
     public void start() throws ModuleStartException {
         handlerMap = builder.build();
-
         createTopicIfNeeded(handlerMap.keySet(), properties);
-
-        if (isSharding) {
-            consumer.assign(topicPartitions);
-        } else {
-            consumer.subscribe(handlerMap.keySet());
+        for (KafkaConsumer<String, Bytes> consumer : consumers) {
+            if (isSharding) {
+                consumer.assign(topicPartitions);
+            } else {
+                consumer.subscribe(handlerMap.keySet());
+            }
+            consumer.seekToEnd(consumer.assignment());
+            executor.submit(() -> {

Review Comment:
   *FutureReturnValueIgnored:*  Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future. [(details)](https://errorprone.info/bugpattern/FutureReturnValueIgnored)
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)



-- 
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: notifications-unsubscribe@skywalking.apache.org

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