Integration / Apache NiFi Interview Questions
What are the NiFi processor scheduling strategies?
NiFi provides two scheduling strategies controlling when a processor's onTrigger method is invoked:
Timer Driven (default): The processor is scheduled to run at a fixed time interval. The Run Schedule property sets the interval — 0 sec means run as fast as possible (yielding only for yield duration), 10 sec means run once every 10 seconds. Most processors use timer-driven scheduling and run in a dedicated thread pool.
CRON Driven: The processor runs according to a CRON expression, enabling time-of-day or day-of-week scheduling. Uses standard CRON syntax with seconds: 0 0 * * * ? runs at the top of every hour; 0 30 9 ? * MON-FRI runs at 09:30 on weekdays. CRON-driven processors run in a separate thread pool.
Additional scheduling parameters:
Concurrent Tasks: How many threads can execute the processor simultaneously. Increasing concurrent tasks enables parallel FlowFile processing. Default is 1 for most processors. Processors must declare thread-safety (@SupportsBatching) to benefit from multiple concurrent tasks.
Execution: All Nodes (default) or Primary Node Only. Primary Node Only is required for processors that would cause duplication if run on multiple cluster nodes simultaneously (ListSFTP, QueryDatabaseTable).
More Related questions...