Created 07-02-2018 10:27 PM
HI all,
I'm working in a custom processor which has to handle log messages, each message has to include information such as the name of incoming connection i.e "try", "failure", "no retry" etc. as well as processor origin name, processor group name and so on.
While I debugged nifi logMessage processor I got StandardRepositoryContext and StandardProcessSession classes which have private access for some properties that contains all information I'm needing.
That classes are located at nifi-framework-core, but once I built my custom processor nar and nifi got started success my custom processor arose a CanntFindClassException. I know the reason is that nifi isolates all dependencies in a nar in order to avoid any conflict.
If someone knows how to solve this trouble or a better solution please let me know.
Regards.
Created 07-03-2018 04:50 PM
Custom components have access to an API, not to the implementations. So a processor has access to ProcessSession which is the API, but not StandardProcessSession which is the implementation.
This is done on purpose so that the NiFi framework can evolve behind the scens as long as it adheres to the API which is the contract with the processors/components.
The only way to get the information you are looking for would be to have an upstream processor add attributes to the flow file containing the relevant information, and then use session.getAttribute(...) to get the attributes you are interested in.
Created 07-09-2018 06:18 PM
Thank you Bryan, the key for this requirement is a loggin problem, we have several LogMessage processors and we are looking for a central processor which handles all messages getting all the information possible; so siteToSiteReportingTask would be a great bet for us. Currently, the trouble we are facing is getting to know how to fetch the incoming connection name IE if a processor fails it will send a fail message through failure relationship, we want to know that record loggin is from that connection.
I'm walking through ExecuteScript path I read this processor could get access for some private props like I'm looking for.
What do you think about it?
Thanks again.
Created 03-27-2019 09:46 PM
How did you achieved this?. Facing the same issue