Created 06-03-2017 04:53 PM
Created 06-06-2017 01:53 PM
The session provides methods to read and write to the flow file content.
In your case, if you are just looking to extract a value then you likely need an InputStreamCallback and you would use the InputStream to read the content and parse it appropriately for your data.
You can look at examples in the existing processors:
Keep in mind, the above example reads the whole content of the flow file into memory which can be dangerous when there are very large flow files, so whenever possible it is best to process the content in chunks.
Created on 06-05-2017 02:05 PM - edited 08-17-2019 11:27 PM
Hello,
Your question is not very clear as to what you are looking for. I am going to assume you are asking how to view the metadata currently associated with a FlowFile passing through your NiFi dataflow(s).
There are several ways to view this metadata:
If you found this answer addressed your question, please mark it as accepted.
Thanks,
Matt
Created 06-06-2017 07:25 AM
Thank you .
Let me be more specific.
How do we get the data Content from a Flowfile from inside a custom processor using the java code?
Assuming that the content of the flowfile is like this:
Name: Value
Example
Colour : Black
I need to retrieve the colour(black) from the flowfile, with java code of my custom processor.
Created 06-06-2017 08:06 AM
Hi Kiran Hebbar,
I think you can use StreamCallback to read your content from a Flowfile. You can modify or add more attributes into flowfile.
Here I find a Matt Burgess's example using Javascript: http://funnifi.blogspot.com/2016/03/executescript-json-to-json-revisited.html
Hope that help you,
Thanks,
Created 06-06-2017 01:53 PM
The session provides methods to read and write to the flow file content.
In your case, if you are just looking to extract a value then you likely need an InputStreamCallback and you would use the InputStream to read the content and parse it appropriately for your data.
You can look at examples in the existing processors:
Keep in mind, the above example reads the whole content of the flow file into memory which can be dangerous when there are very large flow files, so whenever possible it is best to process the content in chunks.