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.

Execute a java program from nifi with parameters

Solved Go to solution

Execute a java program from nifi with parameters

Hi everyone,

i want to take some terms from a cassandra database, and then send them as a parameter to java program which will output some data that i will need to save in a cassandra database.

Is this possible with nifi, if yes, which processors to use? specially for the execution of the java program, since i've seen that processors for cassandra already exists.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Execute a java program from nifi with parameters

@amine adi

You can use the ExecuteStreamCommand processor to run the java program and it uses the expression language, so you will be able to pass attributes as parameters to the command line.

5 REPLIES 5

Re: Execute a java program from nifi with parameters

@amine adi

You can use the ExecuteStreamCommand processor to run the java program and it uses the expression language, so you will be able to pass attributes as parameters to the command line.

Re: Execute a java program from nifi with parameters

Can you please give me an example?

Re: Execute a java program from nifi with parameters

@amine adi

Here is an example of java program being passed the name of the flow file as a parameter on the command line:

15472-screen-shot-2017-05-16-at-40807-pm.png

Re: Execute a java program from nifi with parameters

thanks a lot! just one more question, how to get the output from the java program in nifi?

Re: Execute a java program from nifi with parameters

@amine adi

NiFi does that automatically.

The processor executes an external command on the contents of a flow file, and creates a new flow file with the results of the command.

Don't have an account?
Coming from Hortonworks? Activate your account here