Created 06-25-2018 08:41 PM
I'm issuing the following URL by using a GetHTTP processor named "States", whose URL property - ${DOMAIN} is omitted for issues of brevity - is
which gives me the following results
[
{
id: 1,
name: "Alabama"
},
{
id: 2,
name: "California"
}
...
]
Then I split the array by using a SplitJson processor "Split by state", whose JsonPathExpression property is
$.*
so that I can fetch each object of the array shown above. Next, I use a AttributesToJSON to map the property id to a state flowfile-attribute, as below
Destination - flowfile-attribute
state - $.id
Now, for each spplited JSON object, I want to issue a new GET HTTP called "Municipalities by state" in the form of http://${DOMAIN}/api/states/${state}/municipalities. However, NiFi doesn't allow me "connect" the AttibutesToJson to an GetHttp processor. So What should I do to enable the GetHttp processor "Municipalities by state" ?
Created 06-25-2018 10:09 PM
Use InvokeHTTP processor which allows incoming connections instead of GetHTTP processor
Flow:-
1.GetHTTP
2.SplitJson //split array $.*
3.EvaluateJsonPath //to extract id value and keep as state attribute
4.InvokeHTTP //http://${DOMAIN}/api/states/${state}/municipalities
Created 06-25-2018 10:09 PM
Use InvokeHTTP processor which allows incoming connections instead of GetHTTP processor
Flow:-
1.GetHTTP
2.SplitJson //split array $.*
3.EvaluateJsonPath //to extract id value and keep as state attribute
4.InvokeHTTP //http://${DOMAIN}/api/states/${state}/municipalities