[ 
https://issues.apache.org/jira/browse/KAFKA-4449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16937096#comment-16937096
 ] 

ASF GitHub Bot commented on KAFKA-4449:
---------------------------------------

mjsax commented on pull request #2173: KAFKA-4449: Add Serializer/Deserializer 
for POJO
URL: https://github.com/apache/kafka/pull/2173
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add Serializer/Deserializer for POJO
> ------------------------------------
>
>                 Key: KAFKA-4449
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4449
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>    Affects Versions: 0.10.0.1
>            Reporter: Jason Guo
>            Priority: Minor
>              Labels: easyfix, features, needs-kip
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Currently, there are only build-in serializer/deserializer for basic data 
> type (String, Long, etc). It's better to have serializer/deserializer for 
> POJO.
> If we had this, user can serialize/deserialize all of their POJO with it. 
> Otherwise, user may need to create e pair of serializer and deserializer for 
> each kind of POJO, just like the implementation in the stream example 
> PageViewTypeDemo
> https://github.com/apache/kafka/blob/trunk/streams/examples/src/main/java/org/apache/kafka/streams/examples/pageview/PageViewTypedDemo.java
> Let's take above streams-example as an example, Serde was created for 
> PageView as below
>     final Serializer<PageView> pageViewSerializer = new 
> JsonPOJOSerializer<>();
>     serdeProps.put("JsonPOJOClass", PageView.class);
>     pageViewSerializer.configure(serdeProps, false);
>     final Deserializer<PageView> pageViewDeserializer = new 
> JsonPOJODeserializer<>();
>     serdeProps.put("JsonPOJOClass", PageView.class);
>     pageViewDeserializer.configure(serdeProps, false);
>     final Serde<PageView> pageViewSerde = 
> Serdes.serdeFrom(pageViewSerializer, pageViewDeserializer);
> If we use this POJO serializer/deserializer, the Serde can be created with 
> only one line
> Serdes.serdeFrom(RegionCount.class)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to