Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
1 post
|
I'm failing to setup an example of wire serialization with Protobuf, could you help me figure out what I'm doing wrong? I'm using a simple protobuf schema: ``` syntax = "proto3"; message DemoUserEvent { message Created {...} message Updated {...} ... } ``` From which I'm generating java from this Gradle plugin: ``` plugins { ``` And I'm generating DemoUserEvent instances with Java Iterator looking like this: ``` public class UserEventGenerator implements Iterator<DemoUserEvent>, Serializable { } ... ``` I read those two pieces of documentation: And tried the demo app below: ``` import com.twitter.chill.protobuf.ProtobufSerializer;... public static void main(String[] args) { ``` But the serialization mechanism still fails to handle my protobuf class: 11:22:45,822 INFO org.apache.flink.api.java.typeutils.TypeExtractor [] - class live.schema.event.user.v1.DemoUserEvent does not contain a getter for field payloadCase_ I've also tried this, without success: ``` flinkEnv.getConfig().addDefaultKryoSerializer(DemoUserEvent.class, ProtobufSerializer.class); ``` I'm using those versions: ``` ext { dependencies { ``` Any idea what I should try next? Thanks in advance! |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
356 posts
|
Hey, Why do you say the way you did it, does not work? The logs you posted say the classes cannot be handled by Flink's built-in mechanism for serializing POJOs and it falls back to a GenericType which is serialized with Kryo and should go through your registered serializer. Best, Dawid
On 14/02/2021 11:44, Svend Vanderveken
wrote:
... [show rest of quote]
signature.asc (849 bytes) Download Attachment |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
356 posts
|
Improvements to the documentation are always welcome. In this particular case we actually need to be really careful, as
it is not always the expected behavior. As you are registering
your own kryo serializer it is expected in your case. However more often the case is, you don't want to use the GenericType, but a PojoType and this message helps you to identify a problem with your POJO declaration. Best, Dawid On 15/02/2021 11:50, Svend Vanderveken
wrote:
... [show rest of quote]
signature.asc (849 bytes) Download Attachment |
Free forum by Nabble | Edit this page |