Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Apache Nifi - Convert JSON to XML

I am looking for a nifi Processor/custom Processor that can convert flow file JSON to an XML (Flow file json contain three attributes which two are key columns and one is XML contain)

The main requirement is to add those two attribute into xml contain and generate the new flow file as a XML file.

Appreciate any help.

1 REPLY 1

Guru

@Vicky Thatavarthi

Have you used the Record Readers/Writers in NiFi? If not, here is a good introduction blog:

https://blogs.apache.org/nifi/entry/record-oriented-data-with-nifi

I wrote an HCC article with some data conversion examples:

https://community.hortonworks.com/content/kbentry/115311/convert-csv-to-json-avro-xml-using-convertr...

I haven't tried them myself, but NiFi 1.7.0 (not released yet) will have an XML record reader (https://issues.apache.org/jira/browse/NIFI-4185) and writer (https://issues.apache.org/jira/browse/NIFI-5113).

So, you could use a JSON Record Reader with an XML Record Writer in a ConvertRecord processor for your scenario.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.