Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Apache Nifi - How to quickly serialize a Json on Apache Nifi 1.7.1

avatar

94589-example.png

Please, I need to serialize a text / plain into a json quickly because of the amount of records I have in my workflow, I tried to use the one executescript / jython processor, however, it got very slow due to the json.dumps () class. Please, what is the most performatic way in Nifi to serialize Json? Can you send an example?

Thank you!
1 REPLY 1

avatar
New Contributor
  1. You have to set the attribute "mime.type" to "application/json" with for example the UpdateAttribute-Processor. [Image]
  2. You have to use EvaluateJSONPath-Processor to format it correct. [Image]
  3. You have to configure the EvaluateJSONPath-Processor and add it a attribute. The name is of the attribute doesnt care. As value you set "$". So it will use the whole Flowfile and will format it correctly. [Image]

96620-opera-2019-01-04-13-12-07.png

96621-strokesplus-2019-01-04-13-13-32.png

96622-strokesplus-2019-01-04-13-14-15.png