Created 10-25-2016 02:59 AM
Nifi -- Without writing to disk , is it possible to send flowfile from one peocessor to another ? Ex: i have 3 processors in order- splitjson , evaluatejsonpath , updateattribute processors .
I would like to process only these 3 processors in-memory (from the output of splitjson to update attribute o/p). if it is possible only selected processors in-memory . let us know the process ??
Created 10-26-2016 12:52 PM
As @Bryan Bende has said, it isn't possible with those processors and/or the framework. However, you could emulate this part of the flow with something like ExecuteScript, but you'd be responsible for all the work (reading in the JSON, splitting it, getting the fields out into attributes). Groovy for example has a JsonSlurper which reads in the JSON to an object, at that point you could access the array (using object notation not JSON path), call each(), then further access the members (again using object notation) and set flow file attributes accordingly.
Created 10-25-2016 01:09 PM
There is currently no way to do this. The idea of chaining together a series of processors and having them operate as if they were one processor has been discussed before, and there are some concepts in the framework that could possibly help support this in the future, but currently it does not exist.
Created 10-26-2016 12:52 PM
As @Bryan Bende has said, it isn't possible with those processors and/or the framework. However, you could emulate this part of the flow with something like ExecuteScript, but you'd be responsible for all the work (reading in the JSON, splitting it, getting the fields out into attributes). Groovy for example has a JsonSlurper which reads in the JSON to an object, at that point you could access the array (using object notation not JSON path), call each(), then further access the members (again using object notation) and set flow file attributes accordingly.