Support Questions

Find answers, ask questions, and share your expertise

How to handle the xml data , that is needed to fetch throughout whole process ?

New Contributor

1. I have one very big xml

2. So i get it from from  "ListFile" and "FetchFile" Processors

3. Then i query for some details for my initial processing using "EvaluateXQuery'

4. Then I do some REST calls , so i loose the xml data i had in content

5. Later in flow i need the same input xml data to process , for different purpose.


How can i have access to the xml data throughout the whole process, where I can query and get required data whenever needed.


Another Question:

Can i store it in Attribute and Use replace text.  I have changed the JVM heap settings. Is it feasible for at least 100-200 Mb xml file size?


Please suggest a way to deal this problem?


Super Collaborator


Couple of options I can think of but that depends on your flow and what are you trying to do with the data:


1- Get all the parameters you need through the whole flow from the xml after you fetch the file. Those parameters will be there on every generated flow file later on and at any step you can retrieve them and do whatever needed.

2- If the data you are trying to get downstream from the xml is unrelated you can always have multiple branches after the FetchFile and created different flow for each branch that can run asynchronously.

3- IF you are looking to do different API calls based on the same XML, the InvokeHttp has an Original relationship besides the Response relationship in case each response independent of the others.

4- If you are using Nifi 1.16 and higher and you are looking for data enrichment for the base XML you can look into the processors : ForkEnrichment, JoinEnrichment.



New Contributor

Thanks a lot for suggestion.  Original relationship helped. I am working with 1.13.2. Will check the suggested one. Thanks!