You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2021/03/22 13:19:51 UTC

Re: [camel] 03/03: Fix duplicate field on Kafka component

This looks really wrong. I need to check this when I am done with
something else.
We need that option annotated with the metadata

On Mon, Mar 22, 2021 at 2:03 PM <gn...@apache.org> wrote:
>
> 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 <gn...@gmail.com>
> 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;
> -    }
>  }



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: [camel] 03/03: Fix duplicate field on Kafka component

Posted by Andrea Cosentino <an...@gmail.com>.
Gregor is rebuilding with this fix

Il giorno lun 22 mar 2021 alle ore 14:20 Claus Ibsen <cl...@gmail.com>
ha scritto:

> This looks really wrong. I need to check this when I am done with
> something else.
> We need that option annotated with the metadata
>
> On Mon, Mar 22, 2021 at 2:03 PM <gn...@apache.org> wrote:
> >
> > 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 <gn...@gmail.com>
> > 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;
> > -    }
> >  }
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: [camel] 03/03: Fix duplicate field on Kafka component

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah the field is on the configuration class also, which gets
"inherited" on the component level too.
So this is correct.

On Mon, Mar 22, 2021 at 2:19 PM Claus Ibsen <cl...@gmail.com> wrote:
>
> This looks really wrong. I need to check this when I am done with
> something else.
> We need that option annotated with the metadata
>
> On Mon, Mar 22, 2021 at 2:03 PM <gn...@apache.org> wrote:
> >
> > 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 <gn...@gmail.com>
> > 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;
> > -    }
> >  }
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2