ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Humphrey <hmmlo...@gmail.com>
Subject Re: How to solve SinkRecord cannot be cast exception?
Date Thu, 01 Jun 2017 07:24:00 GMT
How does your class look like that implements the StreamSingleTupleExtractor?

Still you are creating a fruit banana here:

Which gives you the following banana:

When you using Kafka it's not sending you banana but apples as fruits:

So you need to stop creating banana's. Don't use your Testing to create a
new object for SinkRecord. Use the real Kafka to analize what you are
getting as SinkRecord. And try to get the values out of the SinkRecord with
the API from Kafka. It's not only the method record.value() that is needed
you need to look further then that.

So what does the record.value() give you when you run it with the Kafka
You might aswell get the record.value().getClass().getCanonicalName().
>From the information you receive above you know which kind of class you need
to cast to. I'm pretty sure you won't be receiving a Bus (banana) object
like you are doing now with your test method.

-- Humphrey

View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-solve-SinkRecord-cannot-be-cast-exception-unsolved-tp13221p13305.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message