Nifi RestLookupService in LookupRecord gives JsonParseException

Viewed 597

I have a basic NIFI flow with one GenerateFlowFile processor and one LookupRecord processor with RestLookupService. I need to do a rest lookup and enrich the incoming flow file with rest response. Example configuration

I am getting errors that the lookup service is unable to lookup coordinates with the value I am extracting from the incoming flow file.

GenerateFlowFile is configured with simple JSON enter image description here

LookupRecord is configured to extract the key from the JSON and populate it to the RestLookupService. Also, JsonReader and JsonSetWriter is configured to read the incoming flow file and to write the response back to the flow file enter image description here

The RestLookupService itself exits with JsonParseException about unexpected character '<' enter image description here enter image description here

RestLookupService is configured with my API running in the cloud in which I am trying to use the extracted KEY from the incoming flow file. enter image description here

The most interesting bug is that when I configure the URL to point for example to mocky.io everything works correctly so it means that the issue itself is tight with the API URL I am using (http://iotosk.ddns.net:3006/devices/${key}/getParsingData). I have tried also removing the $key, using the exact URL, using different URLs.. Of course the API is working OK over postman/curl anything else. I have checked the logs on the container that the API is running on and there is no requests in the logs what means that nifi is failing even before reaching the API. At least on application level...

I am absolutely out of options without any clue how to solve this. And with nifi also google is not helpful. Does anybody see any issue in the configuration or can point me in some direction what can cause this issue?

1 Answers

After some additional digging. The issue was connected with authentication logic even before the API receives it and that criples the request and and returned XML as Bryan Bende suggested in the comment. But definitely better logging in nifi will help to solve this way faster...

Related