How to pass complex java object (nested maps and lists) from one apache nifi processor to other?

Maha :

I have two functionalities to be implemented through custom nifi processor. The output of the first is input to second. However this output takes form of complex java object (nested hash maps and lists). If I am to implement these two functionalities as separate processors, then how can I pass these complex java objects between two processors. Do I have to convert them to some intermediate form say json or xml and then pass from one processor to another (and then in second processor again convert json/xml back to nested maps and lists)? Or is there some other standard / obvious approach which I miss completely?

PS: Currently I ended up putting both functionalities in the same processor so that I don't have to pass output of the first functionality to the other.

Snail Cadet :

You should be able to serialize the data (https://docs.oracle.com/javase/tutorial/jndi/objects/serial.html) and pass it through a FlowFile.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=146555&siteId=1