Integration / Apache NiFi Interview Questions
What is the UpdateAttribute processor and how is its Advanced Mode used?
UpdateAttribute is one of the most versatile NiFi processors. In basic mode, each User-Defined Property becomes an attribute name, and its value (which can use NiFi Expression Language) becomes the new attribute value. Adding a property processed.timestamp with value ${now():format('yyyy-MM-dd HH:mm:ss')} stamps every FlowFile with a timestamp attribute.
Advanced Mode (accessible via the Advanced button in the processor configuration dialog) adds rule-based conditional attribute modification. You define rules, each with:
- A set of conditions — boolean EL expressions that must all be true for the rule to apply (e.g.,
${mime.type:equals('application/json')}) - A set of actions — attribute name/value pairs applied when the rule matches
Multiple rules are evaluated in order; the FlowPolicy setting controls whether to use the first matching rule or all matching rules. This allows a single UpdateAttribute processor to implement complex attribute-setting logic without chaining multiple processors or writing scripts.
Common basic-mode uses include: computing dynamic file paths from multiple attributes, incrementing retry counters, setting MIME types, building database connection parameters from environment attributes, and normalizing attribute naming conventions.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
