- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
NiFi some basics
- Labels:
-
Apache NiFi
Created ‎11-28-2016 10:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using a InvokeHTTP to call a external rest api and then Extract a few values from the JSON response using EvaluateJSONPath
What I am not able to understand is, why are we doing the extract from flowfile-attributes and not flowfile-content
Comparing the terminology with flume (which I have used before), flowfile-attributes are the Event headers and flowfile-content is Event body
Then how is EvaluateJSONPath is extracting from header using EL
Thanks,
Avijeet
Created ‎12-02-2016 12:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please note that the EvaluateJsonPath
- extracts from content and
- places to content or attributes (depending on whether you configure the Destination property as flowfile-content or flowfile-attribute)
Thus it extracts from content and places to content or attributes.
If you want to extract the headers from the response of InvokeHTTPRequest, you will use EvaluateJsonPath as described above, since the HTTP response header will be part of the json returned and thus part of the FlowFile content. The following post may be helpful:
If this answers your question, let me know by accepting the answer; else, let me know of any gaps or follow-up questions.
Created ‎12-02-2016 12:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please note that the EvaluateJsonPath
- extracts from content and
- places to content or attributes (depending on whether you configure the Destination property as flowfile-content or flowfile-attribute)
Thus it extracts from content and places to content or attributes.
If you want to extract the headers from the response of InvokeHTTPRequest, you will use EvaluateJsonPath as described above, since the HTTP response header will be part of the json returned and thus part of the FlowFile content. The following post may be helpful:
If this answers your question, let me know by accepting the answer; else, let me know of any gaps or follow-up questions.
Created ‎12-02-2016 12:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Greg Keys - I was under impression the we are extracting from attributes. Can you pls share any documentation which clearly explain the lifecycle of a Event/flowfile going through a dataflow and any best practices.
Created ‎12-02-2016 01:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This explains flowfiles:
- [basic] http://docs.hortonworks.com/HDPDocuments/HDF1/HDF-1.1.1/bk_UserGuide/content/terminology.html
- [details/flowfile lifecycle] https://nifi.apache.org/docs/nifi-docs/html/nifi-in-depth.html#DeeperView
This is a good overview of NiFI: https://nifi.apache.org/docs/nifi-docs/html/getting-started.html.
Each processor follows the same idea of flowfile = content + attributes. Following the links to each shows more specialized behavior for that processor in operating on flowfiles (which are passed from one processor to the next via connections)
