[
https://issues.apache.org/jira/browse/STORM-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16258488#comment-16258488
]
Stig Rohde Døssing commented on STORM-2819:
-------------------------------------------
You don't need to generate a POJO for each object type in order to use Kryo
serialization. As long as the object you're serializing has a no-args
constructor and you register it Kryo should be able to figure it out. Here's an
example topology that serializes a JSONObject with Kryo
https://github.com/srdo/storm/blob/demo-jsonobj-serialization/examples/storm-starter/src/jvm/org/apache/storm/starter/ExclamationTopology.java.
I've used json-simple here, but Gson or Jackson setups are going to look very
similar. Note that you need to register the JSONObject class with Kryo in order
for Kryo to serialize it. I also included a bit of code demonstrating how to do
custom serialization in case your classes can't be serialized with Kryo (in
this case using a to String serialization). See also
https://storm.apache.org/releases/2.0.0-SNAPSHOT/Serialization.html.
I don't think we need to build JSON (de)serialization into Storm when Kryo can
easily be configured to do it for us.
> Ability to natively support JSON serialization in topologies
> ------------------------------------------------------------
>
> Key: STORM-2819
> URL: https://issues.apache.org/jira/browse/STORM-2819
> Project: Apache Storm
> Issue Type: Improvement
> Components: storm-core
> Affects Versions: 1.0.2
> Environment: CentOS7, Docker
> Reporter: Anton Alfred
> Priority: Minor
> Labels: features
>
> Now that the world is moving towards NoSQL and most of the data is in JSON.
> Can a native JSON Serializer be implemented similar to support for Kryo.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)