Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Looking for an example where using Kryo and Kafka to serialize/deserialize and transfer a POJO

Solved Go to solution
Highlighted

Looking for an example where using Kryo and Kafka to serialize/deserialize and transfer a POJO

Explorer

I am having trouble finding an example where someone serializes and deserializes a POJO over a Kafka queue. I can send simple strings across, but when I serialize and send a more complex object, I've been getting BufferUnderflows and ArrayOutOfBoundsExceptions.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Looking for an example where using Kryo and Kafka to serialize/deserialize and transfer a POJO

Explorer

The solution that ended up working was to adapt the code I found here:

http://stackoverflow.com/questions/23755976/kafka-writing-custom-serializer

View solution in original post

3 REPLIES 3
Highlighted

Re: Looking for an example where using Kryo and Kafka to serialize/deserialize and transfer a POJO

Mentor

@Adam Doyle

take a look at this example I'm taking json and serializing it but should be same concept with kryo https://github.com/dbist/KafkaHBaseBenchmark

MappingConfig.java look at that class

Highlighted

Re: Looking for an example where using Kryo and Kafka to serialize/deserialize and transfer a POJO

Explorer

The solution that ended up working was to adapt the code I found here:

http://stackoverflow.com/questions/23755976/kafka-writing-custom-serializer

View solution in original post

Highlighted

Re: Looking for an example where using Kryo and Kafka to serialize/deserialize and transfer a POJO

@Adam Doyle I have accepted this as best answer. Thanks for the followup!

Don't have an account?
Coming from Hortonworks? Activate your account here