I am currently working on a NiFi flow that requires the implementation of custom processors to apply transformations on csv records.
I've noticed this behavior during some benchmarks I am performing: if only one thread is assigned to each custom processor everything works well. Assigning more threads to the custom processors results to a failed to process session due to java.lang.NullPointerException.
Since the error cannot be reproduced with a single thread, I am thinking more about some issues in handling the flowfiles, or some aspect of NiFi I am not aware of.
Processing is performed accessing to the flowfile attributes. The flowfile content is never read, and the output flowfile is returned after adding some attributes. The following is a snippet of the relevant parts of the processor code:
@Override
public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
// Will hold all the processed attributes
Map<String, String> processedAttributes = new HashMap<>();
FlowFile flowfile = session.get();
...
// Adds the attributes to the flowfile
flowfile = session.putAllAttributes(flowfile, processedAttributes);
session.transfer(flowfile, PROCESSED);
}
I am running NiFi 0.7 on a m4.4xlarge Amazon ec2 instance. Since I am seeking high performances (who doesn't) I am looking for a safe way to increase the number of threads. Any suggestion is really appreciated.
Thank you in advance.