
Then click on the gear symbol and config as below: Select the Controller Services tab:Ĭlick on the "+" symbol to add the Avro schema registry it will add the Avro schema registry as the above image. This opens the NiFi Flow Configuration window. To Enable Controller Services Select the gear icon from the Operate Palette as shown in the image. Then you will get the pop up as below select XML reader in compatible controller service drop-down as shown below:įollow the same steps to create a controller service for the XML recordset writer as below. In Convert record processor, the properties tab in the RecordReader value column drop down will get as below, then click on create new service. Using a JSON controller service that references the same AvroSchemaRegistry schema

The AvroSchemaRegistry contains a "drivers" schema that defines information about each record (field names, field ids, field types) Using a JsonReader controller service that references a schema in an AvroSchemaRegistry controller service

Step 3: Configure the ConvertRecord and Create Controller Services Here we will use the UpdateAttribute to update the schema name for the avroschema registry as below.Īs shown above, we added a new attribute schema.name as drivers value. For that, we have configured the Input Directory and also provided the file name. Here we are ingesting the drivers_data.json file drivers data from a local directory. We scheduled this processor to run every 60 sec in the Run Schedule and Execution as the Primary node in the SCHEDULING tab. Here we are getting the file from the local directory. NiFi will ignore files it doesn't have at least read permissions for. Here in this scenario, we are going to convert the JSON data to XML format the JSON data looks like shown below:Ĭreates FlowFiles from files in a directory.


Recipe Objective: How to convert files from JSON data to XML format in NiFi?.
