You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Philippe Derome <ph...@gmail.com> on 2016/07/05 21:55:44 UTC

NPE using GenericAvroSerde to deserialize

This is possibly more of a Confluent question as GenericAvroSerde is in
Confluent example code base.

I have a small Stream application, which creates a KTable with String key
and GenericRecord value.

I then specify a Serde<GenericRecord> (new GenericAvroSerde) as value
deserializer when outputting to topic via table.to method.

I get a NPE on deserializing with this.schemaRegistry being null within
AbstractKafkaAvroSerializer#serializeImpl.

Could it be simply that GenericRecords are more of an intermediate class
and are not meant to be serialised?

I'd like to stream the values on topic as GenericRecord. I thought it
should work. Alternatively, guidance on using SpecificAvroSerde would be
very helpful.

Re: NPE using GenericAvroSerde to deserialize

Posted by Philippe Derome <ph...@gmail.com>.
This item is moved to confluent google group.

On Wed, Jul 6, 2016 at 6:25 AM, Philippe Derome <ph...@gmail.com> wrote:

> Please ignore until I become quite more specific about my code usage (will
> try to recover the same code I used). In the mean time, I managed to
> serialize into output topic using a JsonSerde, which was straightforward.
>
> On Wed, Jul 6, 2016 at 5:26 AM, Michael Noll <mi...@confluent.io> wrote:
>
>> Phil,
>>
>> > I then specify a Serde<GenericRecord> (new GenericAvroSerde) as value
>> > deserializer when outputting to topic via table.to method.
>>
>> I suppose that was a typo, and you actually meant "as a value
>> *serializer*", right?
>>
>>
>>
>> On Tue, Jul 5, 2016 at 11:55 PM, Philippe Derome <ph...@gmail.com>
>> wrote:
>>
>> > This is possibly more of a Confluent question as GenericAvroSerde is in
>> > Confluent example code base.
>> >
>> > I have a small Stream application, which creates a KTable with String
>> key
>> > and GenericRecord value.
>> >
>> > I then specify a Serde<GenericRecord> (new GenericAvroSerde) as value
>> > deserializer when outputting to topic via table.to method.
>> >
>> > I get a NPE on deserializing with this.schemaRegistry being null within
>> > AbstractKafkaAvroSerializer#serializeImpl.
>> >
>> > Could it be simply that GenericRecords are more of an intermediate class
>> > and are not meant to be serialised?
>> >
>> > I'd like to stream the values on topic as GenericRecord. I thought it
>> > should work. Alternatively, guidance on using SpecificAvroSerde would be
>> > very helpful.
>> >
>>
>>
>>
>> --
>> Best regards,
>> Michael Noll
>>
>>
>>
>> *Michael G. Noll | Product Manager | Confluent | +1 650.453.5860Download
>> Apache Kafka and Confluent Platform: www.confluent.io/download
>> <http://www.confluent.io/download>*
>>
>
>

Re: NPE using GenericAvroSerde to deserialize

Posted by Philippe Derome <ph...@gmail.com>.
Please ignore until I become quite more specific about my code usage (will
try to recover the same code I used). In the mean time, I managed to
serialize into output topic using a JsonSerde, which was straightforward.

On Wed, Jul 6, 2016 at 5:26 AM, Michael Noll <mi...@confluent.io> wrote:

> Phil,
>
> > I then specify a Serde<GenericRecord> (new GenericAvroSerde) as value
> > deserializer when outputting to topic via table.to method.
>
> I suppose that was a typo, and you actually meant "as a value
> *serializer*", right?
>
>
>
> On Tue, Jul 5, 2016 at 11:55 PM, Philippe Derome <ph...@gmail.com>
> wrote:
>
> > This is possibly more of a Confluent question as GenericAvroSerde is in
> > Confluent example code base.
> >
> > I have a small Stream application, which creates a KTable with String key
> > and GenericRecord value.
> >
> > I then specify a Serde<GenericRecord> (new GenericAvroSerde) as value
> > deserializer when outputting to topic via table.to method.
> >
> > I get a NPE on deserializing with this.schemaRegistry being null within
> > AbstractKafkaAvroSerializer#serializeImpl.
> >
> > Could it be simply that GenericRecords are more of an intermediate class
> > and are not meant to be serialised?
> >
> > I'd like to stream the values on topic as GenericRecord. I thought it
> > should work. Alternatively, guidance on using SpecificAvroSerde would be
> > very helpful.
> >
>
>
>
> --
> Best regards,
> Michael Noll
>
>
>
> *Michael G. Noll | Product Manager | Confluent | +1 650.453.5860Download
> Apache Kafka and Confluent Platform: www.confluent.io/download
> <http://www.confluent.io/download>*
>

Re: NPE using GenericAvroSerde to deserialize

Posted by Michael Noll <mi...@confluent.io>.
Phil,

> I then specify a Serde<GenericRecord> (new GenericAvroSerde) as value
> deserializer when outputting to topic via table.to method.

I suppose that was a typo, and you actually meant "as a value
*serializer*", right?



On Tue, Jul 5, 2016 at 11:55 PM, Philippe Derome <ph...@gmail.com> wrote:

> This is possibly more of a Confluent question as GenericAvroSerde is in
> Confluent example code base.
>
> I have a small Stream application, which creates a KTable with String key
> and GenericRecord value.
>
> I then specify a Serde<GenericRecord> (new GenericAvroSerde) as value
> deserializer when outputting to topic via table.to method.
>
> I get a NPE on deserializing with this.schemaRegistry being null within
> AbstractKafkaAvroSerializer#serializeImpl.
>
> Could it be simply that GenericRecords are more of an intermediate class
> and are not meant to be serialised?
>
> I'd like to stream the values on topic as GenericRecord. I thought it
> should work. Alternatively, guidance on using SpecificAvroSerde would be
> very helpful.
>



-- 
Best regards,
Michael Noll



*Michael G. Noll | Product Manager | Confluent | +1 650.453.5860Download
Apache Kafka and Confluent Platform: www.confluent.io/download
<http://www.confluent.io/download>*