Created 12-16-2020 09:52 AM
I'm totally new to NiFi and learning as I go, but am against a hard deadline and need urgent assistance. I was tasked to create a data interface between two learning systems to send course completion data.
I'm creating a flow to send course completion data from one system to another and have a JSON formatted file (to send as HTTP body to send as a CURL post?)
This is the sample JSON data that I've created so far:
{"user_id":10042,"username":"de","course_id":"C00230","completed_on":"12-02-2020","SCORE":100}
The suggested HTTPS Curl request format is provided below.
curl -v -X POST -d "j_username=admin&j_password=admin&userID=MORRW001&crsID=C00565&dateCompleted=2020-11-16&testScore=100&courseType=a" https://lms.dev.test.net/jw/web/json/data/
How do I configure the InvokeHTTP processor to send it correctly? Do I need to reformat the JSON data so it's in the correct format for the curl format shown above?
Remember I'm just a NiFi novice, so details, including screenshots would be appreciated.
Thanks in advance!
Created 12-16-2020 11:31 PM
Want to get a detailed solution you have to login/registered on the community
Register/LoginCreated 12-17-2020 07:21 AM
Want to get a detailed solution you have to login/registered on the community
Register/LoginCreated 12-18-2020 05:42 AM
Want to get a detailed solution you have to login/registered on the community
Register/LoginCreated 12-16-2020 11:31 PM
Want to get a detailed solution you have to login/registered on the community
Register/LoginCreated 12-17-2020 05:58 AM
@justenji Great response!
@GMAN I have some templates that may help you get a head start:
https://github.com/steven-matison/NiFi-Templates
There are 2 InvokeHttp Examples.
Created 12-17-2020 07:21 AM
Want to get a detailed solution you have to login/registered on the community
Register/LoginCreated 12-17-2020 12:38 PM
@stevenmatisonI used your template and tried to assign attributes using EvaluateJSONPath as show here:
This is the JSON data entering the EvaluateJSONPath processor.
{"user_id":"68","course_id":"HA044","completed_on":"12-15-2020","score":null}
However only the "crsID" and "dateCompleted" attributes are showing as attributes in the queue after this processor and I don't understand why.
Created 12-17-2020 01:33 PM
Thats weird.. did you scroll the attributes list down (just in case its that simple)? i cant see the full modal so not sure.
The config of each attribute looks okay so does the json.
Created 12-17-2020 05:58 PM
@stevenmatisonYou were correct as the other attributes were listed at the bottom of the Attribute Values. I didjn't notice the scroll bar and needed to scroll down.
Thanks again.
Created 12-18-2020 05:42 AM
Want to get a detailed solution you have to login/registered on the community
Register/Login