Created 08-24-2016 02:52 PM
I want to extract twitter data on daily basis for some time. Is there any way to do so using Nifi?
Created on 08-24-2016 03:08 PM - edited 08-19-2019 03:47 AM
Hi @Sushant Bharti,
1) Simple way to schedule would be to use scheduler in the processor to run with cron/timer like below:
In this case, the flow will be running, but the processor will only pull data at the time you specify, you can chose from options there.
2) The other way around this is to use nifi-api to start/stop the processors from outside: you can find details about this in the below question:
Thanks,
Jobin George
Created 08-24-2016 02:59 PM
@Sushant Bharti you have options:
The first configuration option is the Scheduling Strategy. There are three possible options for scheduling components:
more info here
Created 01-09-2017 08:57 AM
Please advice if the Event driven will be now available/implemented for NiFi 1.x and later versions?
Created 08-24-2016 03:04 PM
Anything you can do via the browser can be done my making calls to the NiFi-API.
You could either setup an external process to run a couple curl commands to start and they stop the GetTwitter processor in your flow or you could us a couple invokeHTTP processors in your dataflow (configured using the cron scheduling strategy) to start and stop the GetTwitter processor on a given schedule.
Matt
Created 12-21-2016 09:52 AM
Hi Matt,
I am working on this "curl" stuff but getting an error.
I am using NiFi 1.0
Can you please see the below statements and let me know what I am missing?
This works fine: curl -i -X GET http://localhost:8080/nifi-api/processors/1b943f28-3803-15dd-aec4-d362e560fbaf/state
It gives a json as expected.
............................
This does not work: curl -i -X PUT -H 'Content-Type: application/json' -d '{"version":27,"clientId":"ddf4a732-0158-1000-419b-512493387a32"},"processors":{"id":"1b943f28-3803-15dd-aec4-362e560fbaf","state":"RUNNING"}' http://localhost:8080/nifi-api/processors/1b943f28-3803-15dd-aec4-d362e560fbaf/
This gives:
HTTP/1.1 400 Bad Request Date: Wed, 21 Dec 2016 05:50:43 GMT Content-Type: text/plain Transfer-Encoding: chunked Server: Jetty(9.3.9.v20160517) Message body is malformed. Unable to map into expected format.
Created 12-21-2016 11:58 AM
Created on 08-24-2016 03:08 PM - edited 08-19-2019 03:47 AM
Hi @Sushant Bharti,
1) Simple way to schedule would be to use scheduler in the processor to run with cron/timer like below:
In this case, the flow will be running, but the processor will only pull data at the time you specify, you can chose from options there.
2) The other way around this is to use nifi-api to start/stop the processors from outside: you can find details about this in the below question:
Thanks,
Jobin George