0
votes

I have the below sequence for calling rest API.

invokehttp processor-->split JSON--->jsonpath processor-->text replace processor(for post data creation)---> InvokeHTTP--->XPATH processor for attribute--->original flow file that is generated by splitjson after invoke http processor and create payload--->mqtt.

Here I am calling the rest API and after splitting the large json, I'm using text replace for calling another api(POST request) which uses attributes from original payload of first invoke processor.

After that response of second invoke http response using xpath expression attributes will created, then I have to fetch the splitted response that was created by split json after invoke http processor to create a new request for sending to mqtt. enter image description here So, how can I fetch the invidual records got after spliiting

1

1 Answers

2
votes

It sounds like you're trying to enrich the original JSON record with values from the second HTTP call. If that's the case, consider using LookupRecord with a RestLookupService. This could alleviate the need for ReplaceText -> InvokeHTTP -> EvaluateXPath. If this doesn't do all you need it to, and you're comfortable with a scripting language like Groovy, Jython, or Javascript, you could write your own ScriptedReader to make the second call and extract all the values you need.