Support Questions
Find answers, ask questions, and share your expertise

Implementing Invokehttp Processor In Nifi

Explorer

Please help me out in this scenario:

1. I have to create a new project. The details are accessed using GetFileProcessor.

2. I have passed two input to Invokehttp Processor(one Authorization token using CustomField and other as data to be used for POST action). However, this process is not working as expected.

 

Please find the attached screenshot for reference.

 Invokehttp-Post action.PNG

Data To be used for POST:

midee_0-1625579123463.png

 

 

Early Response much appreciated!

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Implementing Invokehttp Processor In Nifi

Master Guru

@midee 
The invokeHTTP processor will not execute against multiple FlowFiles collectively.  You need to have one FlowFile that contains both your token in a FlowFile attribute and the desired content you are trying to post in the content.

The dataflow that obtains the token could be merged with the other dataflow that has yoru content.
If you have multiple FlowFiles that will need to use the same token, yo could have to separate dataflows.
One that gets the token and rights it to a distributed Map Cache via the PutDistributeMapCache processor.
Second dataflwo the gets your content file and fetches the token via the FetchDistributedMapCache processor.

Then you have one FlowFile with the token you need in an attribute and the content on the FlowFile to be transferred via InvokeHTTP.

If you found this assisted with yoru query, please take a moment to login and click "Accept" on this solution.

Thank you,
Matt

View solution in original post

3 REPLIES 3

Re: Implementing Invokehttp Processor In Nifi

Explorer

Please help me ..This is bit urgent.

 

Thanks!

Re: Implementing Invokehttp Processor In Nifi

Master Guru

@midee 
The invokeHTTP processor will not execute against multiple FlowFiles collectively.  You need to have one FlowFile that contains both your token in a FlowFile attribute and the desired content you are trying to post in the content.

The dataflow that obtains the token could be merged with the other dataflow that has yoru content.
If you have multiple FlowFiles that will need to use the same token, yo could have to separate dataflows.
One that gets the token and rights it to a distributed Map Cache via the PutDistributeMapCache processor.
Second dataflwo the gets your content file and fetches the token via the FetchDistributedMapCache processor.

Then you have one FlowFile with the token you need in an attribute and the content on the FlowFile to be transferred via InvokeHTTP.

If you found this assisted with yoru query, please take a moment to login and click "Accept" on this solution.

Thank you,
Matt

View solution in original post

Re: Implementing Invokehttp Processor In Nifi

Explorer

@MattWho 

Thanks for your reply and let me know about the correct flow.