kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans <jorg.heym...@gmail.com>
Subject Re: kafka-console-consumer --value-deserializer with access to headers
Date Tue, 12 Nov 2019 09:53:33 GMT
Indeed, i corrected the typo but now my deserializer class is not taken into account at all
and it goes back to the default deserializer. You can verify this by putting a non-existent
class and it still runs fine.

value.deserializer=does.not.exist

Jorg

On 2019/11/11 14:31:49, "M. Manna" <manmedia@gmail.com> wrote: 
> You have a typo - you mean deserializer
> 
> Please try again.
> 
> Regards,
> 
> On Mon, 11 Nov 2019 at 14:28, Jorg Heymans <jorg.heymans@gmail.com> wrote:
> 
> > Don't think that option is available there, specifying
> > 'value.deserializer' in my consumer-config.properties file gives
> >
> > [2019-11-11 15:16:26,589] WARN The configuration 'value.serializer' was
> > supplied but isn't a known config.
> > (org.apache.kafka.clients.consumer.ConsumerConfig)
> >
> > Does there exist a description of what properties the consumer-config
> > properties file accepts ? I could find only a few references to it in the
> > documentation.
> >
> > Jorg
> >
> > On 2019/11/11 13:00:03, "M. Manna" <manmedia@gmail.com> wrote:
> > > Hi,
> > >
> > >
> > > On Mon, 11 Nov 2019 at 10:58, Jorg Heymans <jorg.heymans@gmail.com>
> > wrote:
> > >
> > > > Hi,
> > > >
> > > > I have created a class implementing Deserializer, providing an
> > > > implementation for
> > > >
> > > > public String deserialize(String topic, Headers headers, byte[] data)
> > > >
> > > > that does some conditional processing based on headers, and then calls
> > the
> > > > other serde method
> > > >
> > > > public String deserialize(String topic, byte[] data)
> > > >
> > > > What i'm seeing is that kafka-console-consumer only uses the second
> > method
> > > > when a value deserializer is specified. Is there a way to force it to
> > > > invoke the first method, so i can do processing with headers ? I tried
> > > > implementing the deprecated 'ExtendedSerializer' but it does not make
a
> > > > difference.
> > > >
> > > > Thanks,
> > > > Jorg
> > > >
> > >
> > > Have you tried providing a separate prop file using consumer.config
> > > argument? Please see the reference here:
> > >
> > > --consumer.config <String: config file>  Consumer config properties file.
> > > Note
> > >                                            that [consumer-property] takes
> > >                                            precedence over this config.
> > >
> > > Try that and see how it goes.
> > >
> > > Thanks,
> > >
> >
> 

Mime
View raw message