Integration / Apache NiFi Interview Questions
What is the LookupRecord processor used for?
LookupRecord is a record-aware NiFi processor that enriches records within a FlowFile by looking up values from an external source — a database, a distributed map cache, a REST API, or a file-based lookup table — and adding the result as a new field in each record.
LookupRecord works with three components:
RecordReader: Parses the incoming FlowFile into records.
RecordWriter: Serializes enriched records back to the output FlowFile.
LookupService Controller Service: The enrichment data source. Implementations include:
- SimpleCsvFileLookupService: Looks up values from an in-memory CSV file — useful for small static reference tables.
- IPLookupService: GeoIP enrichment from a MaxMind database.
- DatabaseRecordLookupService: Executes a parameterized SQL query against a JDBC source for each lookup.
- DistributedMapCacheLookupService: Looks up values from a distributed in-memory cache populated by another part of the flow.
- RestLookupService: Calls a REST API endpoint for each lookup.
Configuration specifies which record fields are the lookup key(s) and which path in the output record receives the looked-up value. When no match is found, the processor routes to the unmatched relationship for separate handling.
More Related questions...