Is there a way to write to different streams simultaneously in a user processor in NiFi? For example, I have third-party libraries that do significant processing using APIs that work something like this:
public void process(InputStream in, OutputStream foo, OutputStream baa, List<String> args)
{
...
foo.write(things);
baa.write(stuff);
...
}
But the only examples I can find just use one output stream:
FlowFile transform = session.write(original, new OutputStreamCallback() {
@Override
public void process(OutputStream out) throws IOException {
out.write("stuff");
}
});
Processing is performed in batches (due to the large scale), so it is impractical to perform all the processing, and then write out individual threads.
The only way I can come up with is the input process several times :(
To clarify, I want to write several FlowFiles using the method session.write(flowfile, callback), so different threads can be sent / managed separately