You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/10/01 10:37:45 UTC

[camel] branch master updated: camel-kafka avoid using deprecated api

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new b098d75  camel-kafka avoid using deprecated api
b098d75 is described below

commit b098d7522132289043a0c8bb57bff01483326489
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Oct 1 12:32:24 2019 +0200

    camel-kafka avoid using deprecated api
---
 .../main/java/org/apache/camel/component/kafka/KafkaConsumer.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
index 49f31a7..a7cef6e 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.kafka;
 
+import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -287,13 +288,13 @@ public class KafkaConsumer extends DefaultConsumer {
                         log.debug("{} is seeking to the beginning on topic {}", threadId, topicName);
                         // This poll to ensures we have an assigned partition
                         // otherwise seek won't work
-                        consumer.poll(100);
+                        consumer.poll(Duration.ofMillis(100));
                         consumer.seekToBeginning(consumer.assignment());
                     } else if (endpoint.getConfiguration().getSeekTo().equals("end")) {
                         log.debug("{} is seeking to the end on topic {}", threadId, topicName);
                         // This poll to ensures we have an assigned partition
                         // otherwise seek won't work
-                        consumer.poll(100);
+                        consumer.poll(Duration.ofMillis(100));
                         consumer.seekToEnd(consumer.assignment());
                     }
                 }