nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 尹文才 <batman...@gmail.com>
Subject Re: Trigger timer-driven processor to run from outside NIFI
Date Fri, 14 Jul 2017 08:28:56 GMT
Hi Koji, I tried to play with the NIFI REST API with chrome postman app,
when you mentioned about restart the processor via REST API, did you mean
first sending stop command and then send start command via the API "PUT
/processors/{id}"? By the way, when I send the stop command to the
processor, will it finish its work
and then stop the processor or will it simply kill the task directly?
Thanks.

Regards,
Ben

2017-07-14 15:13 GMT+08:00 尹文才 <batman713@gmail.com>:

> Thanks Koji, I checked the NIFI REST API and it seems that I need to use
> Groovy to do it(I don't understand Groovy), is there any Java related
> examples which interact with NIFI via REST API? Thanks.
>
> Regards,
> Ben
>
> 2017-07-14 13:49 GMT+08:00 Koji Kawamura <ijokarumawak@gmail.com>:
>
>> Hi Ben,
>>
>> Just an idea, using ListenHTTP or HandleHTTPRequest (or whatever
>> listener type processor you can use) in front of your processor might
>> be helpful. You also need to change your processor to support incoming
>> FlowFile as well if it doesn't currently. This way, the outside
>> application can send a simple HTTP request to do your processor its
>> job.
>>
>> Another possible way would be using NiFi REST API, stop the processor
>> and then restart it. When the processor is restarted, its onTrigger
>> will be called, and it will wait for next time to be scheduled (next
>> 5min in your case).
>>
>> Thanks,
>> Koji
>>
>> On Wed, Jul 12, 2017 at 5:04 PM, 尹文才 <batman713@gmail.com> wrote:
>> > Hi guys, is it possible for a Java application outside the NIFI
>> environment
>> > to trigger a timer-driven processor to do its work(I mean its ontrigger
>> > method will be called) when the processor is not yet due to be
>> triggered?
>> > The reason why I'm asking about this is because I have a Java
>> applicatiion
>> > with UI outside NIFI and there're some configuration data that could be
>> > updated into a database, and my processor in NIFI need to get the
>> updated
>> > configuration
>> > data from that database as soon as possible, but my processor is
>> configured
>> > to be timer driven of 5 mins. I hope the processor could be triggered to
>> > run after the configuration is updated by the Java application when it's
>> > not yet reached
>> > the time for it to be triggered. Thanks.
>> >
>> > Regards,
>> > Ben
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message