Support Questions

Find answers, ask questions, and share your expertise

Execute a java program from nifi with parameters

avatar

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

avatar
@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.

View solution in original post

6 REPLIES 6

avatar
@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.

avatar

Can you please give me an example?

avatar

@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

avatar

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

avatar
@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.

avatar
New Contributor

What is that jar file about. Is it an application or Single file app.