You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by "BOUKRAA, Kacem" <bk...@esi.dz> on 2016/01/02 09:47:26 UTC

Re: Is it possible to to create a dynamic Processor through API call from PHP

Hello,
I'm using a php script because the source requires an ssl connexion which
is not the case with Nifi connexions.
I've set up a listener (php file with secured connexion), and then once
retrieved, the data is sent to Nifi ListenHTTP processor through POST
request. The thing is i receive them with random names, i'll try to find
out how i can parse them to rename them as JSON files instead of POST
fields.
Thanks for your help.

On 29 December 2015 at 16:50, Joe Percivall <jo...@yahoo.com> wrote:

> Hello Kacem,
>
> There are multiple different ways to get information into NiFi. ListenHTTP
> would be the easiest way to start an HTTP Server that is used to receive
> FlowFiles from remote sources. Assuming your PHP code only acts as a
> router, ListenHTTP should allow you to bypass the PHP code entirely and
> just launch the workflow when it receives an HTTP request from the Web
> Service.
>
> If the PHP code is necessary and it's running on the same box as NiFi then
> you could use the GetFile processor. That mean you write a file via PHP
> then NiFi would grab the file and process it whenever possible. Of course
> there are considerations you have to take into account when you start
> putting things directly onto the file system.
>
> There are many other options for getting files into NiFi and if either of
> these options don't fit your use-case just let us know.
>
> Joe
> - - - - - -
> Joseph Percivall
> linkedin.com/in/Percivall
> e: joepercivall@yahoo.com
>
>
>
> On Tuesday, December 29, 2015 4:56 AM, "BOUKRAA, Kacem" <bk...@esi.dz>
> wrote:
>
>
>
> Hello everyone,
>
> So i'm subscribing to an API Callback in a Web service that send a post
> request once new data is available. I'm receiving this call through PHP.
>
> Is it possible to trigger a processor to retrieve the whole data and
> launch the workflow of processing for that data through another API Call
> from my PHP Code?
>
> (Web service send an API Callback --> My PHP code was listening --> Send
> an API call to Nifi to launch a processor with specific attributes)
>
> Another question: It seems like Nifi has ListenHTTP processor. does it
> allow to have an url to be used as a callback (which means is accessible
> through the network to be used as a API Callback url?).
>
> Thanks in advance.
>



-- 

[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: me@kacemb.com <me...@kacemb.com>*
*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>

Re: Is it possible to to create a dynamic Processor through API call from PHP

Posted by Joe Percivall <jo...@yahoo.com>.
Hello Kacem,

When you say you are receiving them with random names, do you mean the Flowfile filenames or Facebook names? 

Also when you say "i'll try to find out how i can parse them to rename them as JSON files instead of POST fields.", are you trying to change the content of the Flowfile into JSON using the POST fields (or http headers)? If so, the headers should already be added to each Flowfile as attributes and you can just use the AttributesToJSON processor.

[1] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.AttributesToJSON/index.html
 
Joe
- - - - - - 
Joseph Percivall
linkedin.com/in/Percivall
e: joepercivall@yahoo.com



On Saturday, January 2, 2016 11:09 AM, "BOUKRAA, Kacem" <bk...@esi.dz> wrote:



I don't have SSL certificate (in fact i do but i used Let's encrypt certificate which as it seems are not recognized with Facebook API).


On 2 January 2016 at 16:15, Simon Ball <sb...@hortonworks.com> wrote:

Why not use the SSL layer provided by ListenHTTP? 
>
>
>Simon
>
>
>
>
>On 2 Jan 2016, at 08:47, BOUKRAA, Kacem <bk...@esi.dz> wrote:
>>
>>Hello,
>>I'm using a php script because the source requires an ssl connexion which is not the case with Nifi connexions.
>>I've set up a listener (php file with secured connexion), and then once retrieved, the data is sent to Nifi ListenHTTP processor through POST request. The thing is i receive them with random names, i'll try to find out how i can parse them to rename them as JSON files instead of POST fields.
>>Thanks for your help.
>>
>>
>>On 29 December 2015 at 16:50, Joe Percivall <jo...@yahoo.com> wrote:
>>
>>Hello Kacem,
>>>
>>>There are multiple different ways to get information into NiFi. ListenHTTP would be the easiest way to start an HTTP Server that is used to receive FlowFiles from remote sources. Assuming your PHP code only acts as a router, ListenHTTP should allow you to bypass
the PHP code entirely and just launch the workflow when it receives an HTTP request from the Web Service.
>>>
>>>If the PHP code is necessary and it's running on the same box as NiFi then you could use the GetFile processor. That mean you write a file via PHP then NiFi would grab the file and process it whenever possible. Of course there are considerations you have to
take into account when you start putting things directly onto the file system.
>>>
>>>There are many other options for getting files into NiFi and if either of these options don't fit your use-case just let us know.
>>>
>>>Joe
>>>- - - - - -
>>>Joseph Percivall
>>>linkedin.com/in/Percivall
>>>e: joepercivall@yahoo.com
>>>
>>>
>>>
>>>
>>>On Tuesday, December 29, 2015 4:56 AM, "BOUKRAA, Kacem" <bk...@esi.dz> wrote:
>>>
>>>
>>>
>>>Hello everyone,
>>>
>>>So i'm subscribing to an API Callback in a Web service that send a post request once new data is available. I'm receiving this call through PHP.
>>>
>>>Is it possible to trigger a processor to retrieve the whole data and launch the workflow of processing for that data through another API Call from my PHP Code?
>>>
>>>(Web service send an API Callback --> My PHP code was listening --> Send an API call to Nifi to launch a processor with specific attributes)
>>>
>>>Another question: It seems like Nifi has ListenHTTP processor. does it allow to have an url to be used as a callback (which means is accessible through the network to be used as a API Callback url?).
>>>
>>>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: me@kacemb.com
>>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: me@kacemb.com
twitter: @kacem4dz |  website: www.kacemb.com

Re: Is it possible to to create a dynamic Processor through API call from PHP

Posted by "BOUKRAA, Kacem" <bk...@esi.dz>.
I don't have SSL certificate (in fact i do but i used Let's encrypt
certificate which as it seems are not recognized with Facebook API).

On 2 January 2016 at 16:15, Simon Ball <sb...@hortonworks.com> wrote:

> Why not use the SSL layer provided by ListenHTTP?
>
> Simon
>
>
> On 2 Jan 2016, at 08:47, BOUKRAA, Kacem <bk...@esi.dz> wrote:
>
> Hello,
> I'm using a php script because the source requires an ssl connexion which
> is not the case with Nifi connexions.
> I've set up a listener (php file with secured connexion), and then once
> retrieved, the data is sent to Nifi ListenHTTP processor through POST
> request. The thing is i receive them with random names, i'll try to find
> out how i can parse them to rename them as JSON files instead of POST
> fields.
> Thanks for your help.
>
> On 29 December 2015 at 16:50, Joe Percivall <jo...@yahoo.com>
> wrote:
>
>> Hello Kacem,
>>
>> There are multiple different ways to get information into NiFi.
>> ListenHTTP would be the easiest way to start an HTTP Server that is used to
>> receive FlowFiles from remote sources. Assuming your PHP code only acts as
>> a router, ListenHTTP should allow you to bypass the PHP code entirely and
>> just launch the workflow when it receives an HTTP request from the Web
>> Service.
>>
>> If the PHP code is necessary and it's running on the same box as NiFi
>> then you could use the GetFile processor. That mean you write a file via
>> PHP then NiFi would grab the file and process it whenever possible. Of
>> course there are considerations you have to take into account when you
>> start putting things directly onto the file system.
>>
>> There are many other options for getting files into NiFi and if either of
>> these options don't fit your use-case just let us know.
>>
>> Joe
>> - - - - - -
>> Joseph Percivall
>> linkedin.com/in/Percivall
>> e: joepercivall@yahoo.com
>>
>>
>>
>> On Tuesday, December 29, 2015 4:56 AM, "BOUKRAA, Kacem" <
>> bk_boukraa@esi.dz> wrote:
>>
>>
>>
>> Hello everyone,
>>
>> So i'm subscribing to an API Callback in a Web service that send a post
>> request once new data is available. I'm receiving this call through PHP.
>>
>> Is it possible to trigger a processor to retrieve the whole data and
>> launch the workflow of processing for that data through another API Call
>> from my PHP Code?
>>
>> (Web service send an API Callback --> My PHP code was listening --> Send
>> an API call to Nifi to launch a processor with specific attributes)
>>
>> Another question: It seems like Nifi has ListenHTTP processor. does it
>> allow to have an url to be used as a callback (which means is accessible
>> through the network to be used as a API Callback url?).
>>
>> Thanks in advance.
>>
>
>
>
> --
>
> [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: me@kacemb.com <me...@kacemb.com>*
> *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>
>
>
>
>


-- 

[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: me@kacemb.com <me...@kacemb.com>*
*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>

Re: Is it possible to to create a dynamic Processor through API call from PHP

Posted by Simon Ball <sb...@hortonworks.com>.
Why not use the SSL layer provided by ListenHTTP?

Simon

On 2 Jan 2016, at 08:47, BOUKRAA, Kacem <bk...@esi.dz>> wrote:

Hello,
I'm using a php script because the source requires an ssl connexion which is not the case with Nifi connexions.
I've set up a listener (php file with secured connexion), and then once retrieved, the data is sent to Nifi ListenHTTP processor through POST request. The thing is i receive them with random names, i'll try to find out how i can parse them to rename them as JSON files instead of POST fields.
Thanks for your help.

On 29 December 2015 at 16:50, Joe Percivall <jo...@yahoo.com>> wrote:
Hello Kacem,

There are multiple different ways to get information into NiFi. ListenHTTP would be the easiest way to start an HTTP Server that is used to receive FlowFiles from remote sources. Assuming your PHP code only acts as a router, ListenHTTP should allow you to bypass the PHP code entirely and just launch the workflow when it receives an HTTP request from the Web Service.

If the PHP code is necessary and it's running on the same box as NiFi then you could use the GetFile processor. That mean you write a file via PHP then NiFi would grab the file and process it whenever possible. Of course there are considerations you have to take into account when you start putting things directly onto the file system.

There are many other options for getting files into NiFi and if either of these options don't fit your use-case just let us know.

Joe
- - - - - -
Joseph Percivall
linkedin.com/in/Percivall<http://linkedin.com/in/Percivall>
e: joepercivall@yahoo.com<ma...@yahoo.com>



On Tuesday, December 29, 2015 4:56 AM, "BOUKRAA, Kacem" <bk...@esi.dz>> wrote:



Hello everyone,

So i'm subscribing to an API Callback in a Web service that send a post request once new data is available. I'm receiving this call through PHP.

Is it possible to trigger a processor to retrieve the whole data and launch the workflow of processing for that data through another API Call from my PHP Code?

(Web service send an API Callback --> My PHP code was listening --> Send an API call to Nifi to launch a processor with specific attributes)

Another question: It seems like Nifi has ListenHTTP processor. does it allow to have an url to be used as a callback (which means is accessible through the network to be used as a API Callback url?).

Thanks in advance.



--

[Image]
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: me@kacemb.com<ma...@kacemb.com>
twitter: @kacem4dz |  website: www.kacemb.com<http://www.kacemb.com/>
 [https://s3.amazonaws.com/images.wisestamp.com/icons/facebook.png] <https://www.facebook.com/KacemRostomBoukraa>  [https://s3.amazonaws.com/images.wisestamp.com/icons/googleplus.png] <https://plus.google.com/u/0/+KacemBOUKRAA>  [https://s3.amazonaws.com/images.wisestamp.com/icons/linkedin.png] <https://www.linkedin.com/profile/view?id=177866682>  [https://s3.amazonaws.com/images.wisestamp.com/icons/twitter.png] <https://twitter.com/kacem4dz>