Re: Example for Jackson JsonNode Kafka serialization schema

2022-01-28 Thread Robert Metzger
Hi Oran, as you've already suggested, you could just use a (flat)map function that takes an ObjectNode and outputs a string. In the mapper, you can do whatever you want in case of an invalid object: logging about it, discarding it, writing an "error json string", writing to a side output stream, .

Example for Jackson JsonNode Kafka serialization schema

2022-01-25 Thread Oran Shuster
In the documentation we have an example on how to implement deserialization from bytes to Jackson ObjectNode objects - JSONKeyValueDeserializationSchema https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/connectors/datastream/kafka/ However, there is no example on the other direction:

Re: KafkaProducer with generic (Avro) serialization schema

2018-05-02 Thread Wouter Zorgdrager
> >> On 1 May 2018, at 16:30, Wouter Zorgdrager wrote: >> >> So, I'm still struggling with this issue. I dived a bit more into the >> problem and I'm pretty sure that the problem is that I have to (implicitly) >> pass the SchemaFor and RecordTo classes t

Re: KafkaProducer with generic (Avro) serialization schema

2018-05-02 Thread Fabian Hueske
n 1 May 2018, at 16:30, Wouter Zorgdrager wrote: > > So, I'm still struggling with this issue. I dived a bit more into the > problem and I'm pretty sure that the problem is that I have to (implicitly) > pass the SchemaFor and RecordTo classes to my serialization schema > (o

Re: KafkaProducer with generic (Avro) serialization schema

2018-05-02 Thread Aljoscha Krettek
dived a bit more into the >> problem and I'm pretty sure that the problem is that I have to (implicitly) >> pass the SchemaFor and RecordTo classes to my serialization schema >> (otherwise I can't make it generic). However those class aren't >> serializable

Re: KafkaProducer with generic (Avro) serialization schema

2018-05-02 Thread Piotr Nowojski
pretty sure that the problem is that I have to (implicitly) pass the > SchemaFor and RecordTo classes to my serialization schema (otherwise I can't > make it generic). However those class aren't serializable, but of course I > can't annotate them transient nor make it a la

Re: KafkaProducer with generic (Avro) serialization schema

2018-05-01 Thread Wouter Zorgdrager
So, I'm still struggling with this issue. I dived a bit more into the problem and I'm pretty sure that the problem is that I have to (implicitly) pass the SchemaFor and RecordTo classes to my serialization schema (otherwise I can't make it generic). However those class aren't

Re: KafkaProducer with generic (Avro) serialization schema

2018-04-26 Thread Wouter Zorgdrager
Zorgdrager [mailto:zorgdrag...@gmail.com] > *Sent:* Wednesday, April 25, 2018 7:17 AM > *To:* user@flink.apache.org > *Subject:* KafkaProducer with generic (Avro) serialization schema > > > > Dear reader, > > > > I'm currently working on writing a Kafk

RE: KafkaProducer with generic (Avro) serialization schema

2018-04-25 Thread Nortman, Bill
) serialization schema Dear reader, I'm currently working on writing a KafkaProducer which is able to serialize a generic type using avro4s. However this serialization schema is not serializable itself. Here is my code for this: The serialization schema: class AvroSerializationSche

KafkaProducer with generic (Avro) serialization schema

2018-04-25 Thread Wouter Zorgdrager
Dear reader, I'm currently working on writing a KafkaProducer which is able to serialize a generic type using avro4s. However this serialization schema is not serializable itself. Here is my code for this: The serialization schema: class AvroSerializationSchema[IN : SchemaFor : FromR

Re: Serialization schema

2017-02-26 Thread Mohit Anchlia
to write to kafka however I am >>>>> getting this error. Not sure why as I've already implemented the >>>>> interfaces. >>>>> >>>>> Caused by: java.io.NotSerializableException: >>>>> com.sy.flink.test.Tuple2Serializerr$1 >>>>> at java.io.ObjectOutputStream.wri >>>>> teObject0(ObjectOutputStream.java:1184) >>>>> at java.io.ObjectOutputStream.def >>>>> aultWriteFields(ObjectOutputStream.java:1548) >>>>> >>>>> And the class implements the following: >>>>> >>>>> *public* *class* *Tuple2Serializerr* *implements* >>>>> >>>>> DeserializationSchema>, >>>>> >>>>> SerializationSchema> { >>>>> >>>>> And called like this: >>>>> >>>>> >>>>> FlinkKafkaProducer010> myProducer = *new* >>>>> FlinkKafkaProducer010>( >>>>> >>>>> "10.22.4.15:9092", // broker list >>>>> >>>>> "my-topic", // target topic >>>>> >>>>> *new* Tuple2Serializerr()); // serialization schema >>>>> >>>>> >>>>> >>>>> >>>> >>> >> >

Re: Serialization schema

2017-02-23 Thread Tzu-Li (Gordon) Tai
FlinkKafkaProducer010> myProducer = new FlinkKafkaProducer010>( "10.22.4.15:9092", // broker list "my-topic", // target topic new Tuple2Serializerr()); // serialization schema

Re: Serialization schema

2017-02-23 Thread Mohit Anchlia
Object0(ObjectOutputStream.j >>>> ava:1184) >>>> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputSt >>>> ream.java:1548) >>>> >>>> And the class implements the following: >>>> >>>> *public* *class* *Tuple2Serializerr* *implements* >>>> >>>> DeserializationSchema>, >>>> >>>> SerializationSchema> { >>>> >>>> And called like this: >>>> >>>> >>>> FlinkKafkaProducer010> myProducer = *new* >>>> FlinkKafkaProducer010>( >>>> >>>> "10.22.4.15:9092", // broker list >>>> >>>> "my-topic", // target topic >>>> >>>> *new* Tuple2Serializerr()); // serialization schema >>>> >>>> >>>> >>>> >>> >> >

Re: Serialization schema

2017-02-23 Thread Tzu-Li (Gordon) Tai
ducer010>( "10.22.4.15:9092", // broker list "my-topic", // target topic new Tuple2Serializerr()); // serialization schema

Re: Serialization schema

2017-02-23 Thread Mohit Anchlia
gt;>> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputSt >>> ream.java:1548) >>> >>> And the class implements the following: >>> >>> *public* *class* *Tuple2Serializerr* *implements* >>> >>> DeserializationSchema>,

Re: Serialization schema

2017-02-23 Thread Tzu-Li (Gordon) Tai
:9092", // broker list "my-topic", // target topic new Tuple2Serializerr()); // serialization schema

Re: Serialization schema

2017-02-23 Thread Mohit Anchlia
*Tuple2Serializerr* *implements* >> >> DeserializationSchema>, >> >> SerializationSchema> { >> >> And called like this: >> >> >> FlinkKafkaProducer010> myProducer = *new* >> FlinkKafkaProducer010>( >> >> "10.22.4.15:9092", // broker list >> >> "my-topic", // target topic >> >> *new* Tuple2Serializerr()); // serialization schema >> >> >> >> >

Re: Serialization schema

2017-02-23 Thread 刘彪
t; myProducer = *new* > FlinkKafkaProducer010>( > > "10.22.4.15:9092", // broker list > > "my-topic", // target topic > > *new* Tuple2Serializerr()); // serialization schema > > > >

Serialization schema

2017-02-23 Thread Mohit Anchlia
gt; myProducer = *new* FlinkKafkaProducer010>( "10.22.4.15:9092", // broker list "my-topic", // target topic *new* Tuple2Serializerr()); // serialization schema