Created 04-10-2019 05:11 PM
I have a requirement where I want to generate a unique id once the flow is triggered and this will be used as a sessionid of the flow So I have used GenerateFlowFile processor with ${UUID()} so I want to append this uuid to each flowfile so that I can use it in sitetosite provenance for monitoring.
How can I store or share this in entire flow for each trigger?
DistributedMapCache can be used here? I am not sure if this will be able to handle session wise and in concurrent request?
Created 04-10-2019 05:33 PM
Each flow file in the system automatically has an attribute "uuid" set to a unique identifier, this attribute is available in provenance events, via Expression Language (use "uuid" instead of "UUID()"). Is this what you are looking for? Or do you want a separate attribute that would remain the same even if the flow changes flow files (Split, Merge, e.g.)?
Created 04-10-2019 05:45 PM
Or are you looking for a unique ID that is assigned to every FlowFile that is traverses a specific set of processors (dataflow) on the NiFi canvas. That way you can track which FlowFiles were processed by which dataflow?
If so, rather then using the UUID() NiFi Expression Language (EL) function , why not just have an updateAttribute processor in each on of these unique dataflows set a static value on each FlowFile? for exampe:
sessionID = dataflow1
Created 04-11-2019 05:19 AM
No I want whenever the nifi flow is triggered there should be a uniqueid across all processors.