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

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

commit e00be52c186bc926a27a31164c6f5fe1cb69ca49
Author: Guillaume Nodet <[email protected]>
AuthorDate: Mon Mar 22 14:02:59 2021 +0100

    Fix duplicate field on Kafka component
---
 .../camel/component/kafka/KafkaComponent.java       | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
index dff7fd2..aa536ea 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaComponent.java
@@ -39,10 +39,9 @@ public class KafkaComponent extends DefaultComponent 
implements SSLContextParame
     private KafkaClientFactory kafkaClientFactory = new 
DefaultKafkaClientFactory();
     @Metadata(autowired = true, label = "consumer,advanced")
     private PollExceptionStrategy pollExceptionStrategy;
-    @Metadata(label = "consumer", defaultValue = "ERROR_HANDLER")
-    private PollOnError pollOnError = PollOnError.ERROR_HANDLER;
 
     public KafkaComponent() {
+        configuration.setPollOnError(PollOnError.ERROR_HANDLER);
     }
 
     public KafkaComponent(CamelContext context) {
@@ -64,7 +63,6 @@ public class KafkaComponent extends DefaultComponent 
implements SSLContextParame
         KafkaConfiguration copy = getConfiguration().copy();
         endpoint.setConfiguration(copy);
         endpoint.getConfiguration().setTopic(remaining);
-        endpoint.getConfiguration().setPollOnError(pollOnError);
 
         setProperties(endpoint, parameters);
 
@@ -142,21 +140,4 @@ public class KafkaComponent extends DefaultComponent 
implements SSLContextParame
         this.pollExceptionStrategy = pollExceptionStrategy;
     }
 
-    public PollOnError getPollOnError() {
-        return pollOnError;
-    }
-
-    /**
-     * What to do if kafka threw an exception while polling for new messages.
-     *
-     * The default is ERROR_HANDLER.
-     *
-     * DISCARD will discard the message and continue to poll next message. 
ERROR_HANDLER will use Camel's error handler
-     * to process the exception, and afterwards continue to poll next message. 
RECONNECT will re-connect the consumer
-     * and try poll the message again RETRY will let the consumer retry 
polling the same message again STOP will stop
-     * the consumer (have to be manually started/restarted if the consumer 
should be able to consume messages again)
-     */
-    public void setPollOnError(PollOnError pollOnError) {
-        this.pollOnError = pollOnError;
-    }
 }

Reply via email to