Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-8634

Create Controller Services that allows user to choose between Record Readers/Writers based on Expression Language

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Extensions
    • None

    Description

      Typically when a user builds a flow, the user must choose a JSON Reader, CSV Reader, JSON Writer, CSV Writer, etc. whatever makes sense for their use case.

      The downside to this approach is that it makes it difficult to build a flow is more generically distributable.

      We should create a RecordReaderLookup service and a RecordWriterLookup service. Each would have a single well-known property for the name of the Record Reader/Writer service to use. User-defined properties would then be used to define those Record Readers/Writers.

      For example, one might configure RecordReaderLookup as such:

      Selected Reader: #{DataFOrmat}
      csv: CSVReader
      json: JsonTreeReader
      avro: AvroReader 

      In this case, CSVReader, JsonTreeReader, and AvroReader are other Record Reader Controller Services. Now, a parameter can be defined with the name DataFormat. If that parameter has a value of csv, the CSVReader would be used. If the parameter has a value of json, the JsonTreeReader would be used, and so forth.

      Same principle would be followed for the Record Writer.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: