[ 
https://issues.apache.org/jira/browse/NIFI-7505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17128519#comment-17128519
 ] 

Andy LoPresto commented on NIFI-7505:
-------------------------------------

My initial thought was that the request type (HTTP method, etc.) is going to be 
the same for each record, so the common use cases are:

# Data enrichment to consistent URL endpoint via {{GET}} per record (i.e. a 
_lookup_)
# Batch {{POST}} submission (i.e. each record has some data which needs to be 
submitted to a remote endpoint)
# Multiple URL operation (i.e. each record _is_ or _has_ a URL in it, and the 
outgoing request URLs will be unique to each record)

I think there should be a configurable property to determine the destination of 
the responses. The options would be {{Record - inline}}, {{Record - replace}}, 
and {{New flowfile}}. 

* {{Record - inline}} - puts the HTTP response code & response body in the 
record itself. An additional property called {{Record response identifier}} 
would accept an optional value to use as the column/field name
* {{Record - replace}} - puts the HTTP response code & response body as the new 
record value
* {{New flowfile}} - puts the HTTP response code & response body as the 
flowfile content of a new flowfile for each record. This would function similar 
to the {{SplitRecord}} or {{PartitionRecord}} processors

Yes, the processor must have a way to reference the record values in order to 
craft the URL and request body. I would suggest using the 
[RecordPath|https://nifi.apache.org/docs/nifi-docs/html/record-path-guide.html] 
syntax, as it already exists to extract values from the record structure and is 
format agnostic. 

> Add InvokeHTTPRecord processor
> ------------------------------
>
>                 Key: NIFI-7505
>                 URL: https://issues.apache.org/jira/browse/NIFI-7505
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: 1.11.4
>            Reporter: Andy LoPresto
>            Priority: Major
>              Labels: Record, http, processor, rest
>
> Some users have recently requested being able to invoke a specific URL via 
> {{InvokeHTTP}} on every record in a flowfile. Currently, the {{InvokeHTTP}} 
> processor can only handle one piece of data per flowfile. There are some 
> workarounds available for specific patterns with {{LookupRecord}} + 
> {{RestLookupService}}, but this is not a complete solution. I propose 
> introducing an {{InvokeHTTPRecord}} processor, providing the {{InvokeHTTP}} 
> functionality in conjunction with the record processing behavior. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to