I would like to thanks you, i'll be trying this and get back to you.
As it seems, the nifi API allows to trigger processors distantly (from
other componant suck as spark, kafka, etc) which would be very helpful in
case i want to do a batch processing and trigger extra requests on the go.


On 1 December 2015 at 17:45, Joe Percivall <[email protected]> wrote:

> Ah that makes the use-case a lot simpler.
>
> Given the list of commenters you can pass it into SplitJSON which you can
> use to split the data objects into multiple flowfiles. Then use
> EvaluateJSONPath to add the ids to an attribute of the flowfile. Finally
> use InvokeHTTP and the expression language to create a request out of the
> attributes.
>
> Cheers,
> Joe
>
> - - - - - -
> Joseph Percivall
> linkedin.com/in/Percivall
> e: [email protected]
>
>
>
>
> On Tuesday, December 1, 2015 11:23 AM, "BOUKRAA, Kacem" <[email protected]>
> wrote:
>
>
>
> Thanks for the answer, i'll be considering your suggestion for further
> documentation.
>
> For your second question, there no policy for doing this, i want just to
> that from a given list of ID (from a text file maybe with an ID for each
> line), the structure of the link is the same (i.e:
> graphs.facebook.com/user+id  only the id changes).
> Here is the comments example. i have many people who commented the post, i
> need to do an HTTP request for each one. So i need to invoke not one HTTP
> request but many after each retrieval of one post comment.
> Kindly.
>
> ​
>
>
>
> On 1 December 2015 at 17:07, Joe Percivall <[email protected]> wrote:
>
> Hello Kacem,
> >
> >For your first question you can set up a relatively simple flow to
> achieve this. Assuming the first retrieval is a GET method call you can do:
> GetHTTP -> ExtractText -> InvokeHTTP. What this does is, it first gets the
> JSON files from the social network using GetHTTP. Then with ExtractText you
> extract the values you are interested in using in the last Invoke (in other
> words add the values as attributes of the FlowFile). Then in InvokeHTTP use
> the attribute expression language [1] to form your request. The docs for
> the processors can be found here[2].
> >
> >For the second scenario, are you specifically asking how to create calls
> that hit the ids 1-1000 in a round robin fashion or is there a specific way
> you determine the ids/scheduling?
> >
> >[1]
> https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html
> >[2] https://nifi.apache.org/docs.html
> >
> >Welcome to NiFi!
> >Joe
> >
> >
> >- - - - - - Joseph Percivall
> >linkedin.com/in/Percivall
> >e: [email protected]
> >
> >
> >
> >
> >On Tuesday, December 1, 2015 10:35 AM, "BOUKRAA, Kacem" <
> [email protected]> wrote:
> >
> >
> >
> >
> >
> >Hello everyone,
> >So my case is as the following, i'm trying to retrieve JSON files from a
> social network (Facebook), and based on some values in the file of the HTTP
> response i want to invoke a new HTTP requests dynamically (in function of
> the total number of values count).
> >Ex: Retrieve a JSON file for a page publication in Facebook Page (with
> HTTP request), and then retrieve the info about each profil of each one who
> commented on that publication.
> >So is there any way to achieve this?
> >Another question, Is there any Loop possibility for creating a new
> instances of a HTTP processor with different parameter for each (the
> profile ID for each one who commented)?
> >(Ex: graphs.facebook.com/ID1, graphs.facebook.com/ID2 ..
> graphs.facebook.com/ID1000 without creating each processor separately),
> If this not possible do you recommend me to use Flume for this purpose?
> >​Thanks in advance :)​--
> >
> >
> >
> >
> >Kacem BOUKRAA
> >5thyear student at ESI | Higher National School Of Computer Science
> (Information Systems)
> >Google Student Ambassador in Algeria
> >Kouba - Alger
> >
> >mobile: +213 559 859 858 |  email: [email protected]
> >twitter: @kacem4dz |  website: www.kacemb.com
> >
>
>
> --
>
>
>
> Kacem BOUKRAA
> 5thyear student at ESI | Higher National School Of Computer Science
> (Information Systems)
> Google Student Ambassador in Algeria
> Kouba - Alger
>
> mobile: +213 559 859 858 |  email: [email protected]
> twitter: @kacem4dz |  website: www.kacemb.com
>



-- 

[image: Image]

*Kacem BOUKRAA**5**th**year student at ESI | Higher National School Of
Computer Science** (Information Systems)*
*Google Student Ambassador in Algeria*

*Kouba - Alger*
*mobile: +213 559 859 858 |  **email: [email protected] <[email protected]>*
*twitter: @kacem4dz |  website: www.kacemb.com <http://www.kacemb.com>*
  <https://www.facebook.com/KacemRostomBoukraa>
<https://plus.google.com/u/0/+KacemBOUKRAA>
<https://www.linkedin.com/profile/view?id=177866682>
<https://twitter.com/kacem4dz>

Reply via email to