Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Execute a java program from nifi with parameters

avatar
New Member

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
New Member

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
New Member

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 Member

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