Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I want to know if is it possible to use flowfile size as an argument in routeOnAttribute i want to make expression like that :
${filename.fileSize>500}
but it tells me that expression ought to return true and my expression returns string what should i do to be able to make new connection in routeOnAttribute(p.s filename is my flowfile name)
EDIT 05/17/2019 Correct answer is Andy's. That is the best guidance from us (Apache NiFi team) on the subject. The answer marked "correct" only applies in a few cases where Content-Length
is set by an upstream processor. Andy's solution, fileSize
is universally applicable.
–
–
Your expression is logically correct but does not use valid Apache NiFi syntax. It should use the gt
function as below:
${fileSize:gt(500)}
This will return a boolean
result.
Two ways to check empty response present in flowfile.
1.Using Content-Length attribute-->${Content-Length}
2.Using Extract Text processor to extracts entire content in attribute.
flow_content--(.*)
then check ${flow_content:isEmpty():not()}
It may be helpful for your case.
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.