Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

NIFI - How to set properties of a Processor through java api?

Highlighted

Re: NIFI - How to set properties of a Processor through java api?

Super Guru

Maybe try the @Override annotation? Also are you using any generic types in your class declaration (like MyGetSFTP<T>)?

Highlighted

Re: NIFI - How to set properties of a Processor through java api?

Yes I tried the @override annotation too, unsuccessfully. And no generic types in the class declaration. I have no idea why the framework works in this way, although the subclass method override the superclass method.

Help!

Highlighted

Re: NIFI - How to set properties of a Processor through java api?

Ok, maybe I performed your step 4. halfway because I was overriding just the methods really necessary to perform the task. Since the annotated methods in the subclass are not automatically called, I have overriden all the methods in the superclass, as you stated in the step 4., calling the original method and passing it the MyProcessContext object (e.g. the onTrigger method) setting up the configuration from the config file and magically it started to work!

Thank you very much!

Highlighted

Re: NIFI - How to set properties of a Processor through java api?

New Contributor

I am facing the similar problem...Can you share how to intialize ProcessContext object and call the method :

public void onScheduled(final ProcessContext context)  method....Pls share the snippet

 

Re: NIFI - How to set properties of a Processor through java api?

Community Manager

@saachinahuja I suggest opening a new thread on your issue due to the age of this thread. A new thread will also provide the opportunity to include the factors unique to your situation.  



Cy Jervis, Community Manager

Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Learn more about the Cloudera Community:
Community Guidelines
How to use the forum
Don't have an account?
Coming from Hortonworks? Activate your account here