You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Lokesh Sharma <lo...@gmail.com> on 2018/08/27 06:16:02 UTC

How to run a job every 5 seconds in Ignite

I'm using Ignite with Spring Boot. Is there a way to run a job every 5
seconds on exactly one node of the cluster (which could be any node)?

Thank You

Re: How to run a job every 5 seconds in Ignite

Posted by Lokesh Sharma <lo...@gmail.com>.
I managed to run the task every x seconds using an infinite loop
though. "deployClusterSingleton" was the key to make it work. Many thanks.

On Thu, Aug 30, 2018 at 12:57 PM Lokesh Sharma <lo...@gmail.com>
wrote:

> That didn't help because extended syntax is not for running task every x
> seconds. It specifies the delay in seconds to run the task for first time
> and number of times the task has to be executed.
>
> On Tue, Aug 28, 2018 at 2:15 PM Павлухин Иван <vo...@gmail.com> wrote:
>
>> Hi Lokesh,
>>
>> You could try out extended cron syntax implemented by Ignite [1].
>>
>> [1]
>> https://apacheignite.readme.io/docs/cron-based-scheduling#section-syntax-extension
>>
>>
>> 2018-08-28 10:51 GMT+03:00 Lokesh Sharma <lo...@gmail.com>:
>>
>>> Is it possible to run the job every few seconds? As far as I know, cron
>>> API doesn't support scheduling in seconds.
>>>
>>> On Tue, Aug 28, 2018 at 11:27 AM Lokesh Sharma <lo...@gmail.com>
>>> wrote:
>>>
>>>> This is what I was looking for. Many thanks!
>>>>
>>>> On Mon, Aug 27, 2018 at 3:01 PM Evgenii Zhuravlev <
>>>> e.zhuravlev.wk@gmail.com> wrote:
>>>>
>>>>> Hi Lokesh,
>>>>>
>>>>> I'd suggest to start Ignite service, which will guarantee
>>>>> failover-safety for you:
>>>>> https://apacheignite.readme.io/docs/service-grid. Just choose
>>>>> cluster-singleton to make sure that you will have 1 instance of Service in
>>>>> cluster. Inside this service you can use ignite-scheduler:
>>>>> https://apacheignite.readme.io/docs/cron-based-scheduling, it has
>>>>> cron API.
>>>>>
>>>>> Evgenii
>>>>>
>>>>> пн, 27 авг. 2018 г. в 9:16, Lokesh Sharma <lo...@gmail.com>:
>>>>>
>>>>>> I'm using Ignite with Spring Boot. Is there a way to run a job every
>>>>>> 5 seconds on exactly one node of the cluster (which could be any node)?
>>>>>>
>>>>>> Thank You
>>>>>>
>>>>>
>>
>>
>> --
>> Best regards,
>> Ivan Pavlukhin
>>
>

Re: How to run a job every 5 seconds in Ignite

Posted by Lokesh Sharma <lo...@gmail.com>.
That didn't help because extended syntax is not for running task every x
seconds. It specifies the delay in seconds to run the task for first time
and number of times the task has to be executed.

On Tue, Aug 28, 2018 at 2:15 PM Павлухин Иван <vo...@gmail.com> wrote:

> Hi Lokesh,
>
> You could try out extended cron syntax implemented by Ignite [1].
>
> [1]
> https://apacheignite.readme.io/docs/cron-based-scheduling#section-syntax-extension
>
>
> 2018-08-28 10:51 GMT+03:00 Lokesh Sharma <lo...@gmail.com>:
>
>> Is it possible to run the job every few seconds? As far as I know, cron
>> API doesn't support scheduling in seconds.
>>
>> On Tue, Aug 28, 2018 at 11:27 AM Lokesh Sharma <lo...@gmail.com>
>> wrote:
>>
>>> This is what I was looking for. Many thanks!
>>>
>>> On Mon, Aug 27, 2018 at 3:01 PM Evgenii Zhuravlev <
>>> e.zhuravlev.wk@gmail.com> wrote:
>>>
>>>> Hi Lokesh,
>>>>
>>>> I'd suggest to start Ignite service, which will guarantee
>>>> failover-safety for you:
>>>> https://apacheignite.readme.io/docs/service-grid. Just choose
>>>> cluster-singleton to make sure that you will have 1 instance of Service in
>>>> cluster. Inside this service you can use ignite-scheduler:
>>>> https://apacheignite.readme.io/docs/cron-based-scheduling, it has
>>>> cron API.
>>>>
>>>> Evgenii
>>>>
>>>> пн, 27 авг. 2018 г. в 9:16, Lokesh Sharma <lo...@gmail.com>:
>>>>
>>>>> I'm using Ignite with Spring Boot. Is there a way to run a job every 5
>>>>> seconds on exactly one node of the cluster (which could be any node)?
>>>>>
>>>>> Thank You
>>>>>
>>>>
>
>
> --
> Best regards,
> Ivan Pavlukhin
>

Re: How to run a job every 5 seconds in Ignite

Posted by Павлухин Иван <vo...@gmail.com>.
Hi Lokesh,

You could try out extended cron syntax implemented by Ignite [1].

[1]
https://apacheignite.readme.io/docs/cron-based-scheduling#section-syntax-extension


2018-08-28 10:51 GMT+03:00 Lokesh Sharma <lo...@gmail.com>:

> Is it possible to run the job every few seconds? As far as I know, cron
> API doesn't support scheduling in seconds.
>
> On Tue, Aug 28, 2018 at 11:27 AM Lokesh Sharma <lo...@gmail.com>
> wrote:
>
>> This is what I was looking for. Many thanks!
>>
>> On Mon, Aug 27, 2018 at 3:01 PM Evgenii Zhuravlev <
>> e.zhuravlev.wk@gmail.com> wrote:
>>
>>> Hi Lokesh,
>>>
>>> I'd suggest to start Ignite service, which will guarantee
>>> failover-safety for you: https://apacheignite.readme.
>>> io/docs/service-grid. Just choose cluster-singleton to make sure that
>>> you will have 1 instance of Service in cluster. Inside this service you can
>>> use ignite-scheduler: https://apacheignite.readme.io/docs/
>>> cron-based-scheduling, it has cron API.
>>>
>>> Evgenii
>>>
>>> пн, 27 авг. 2018 г. в 9:16, Lokesh Sharma <lo...@gmail.com>:
>>>
>>>> I'm using Ignite with Spring Boot. Is there a way to run a job every 5
>>>> seconds on exactly one node of the cluster (which could be any node)?
>>>>
>>>> Thank You
>>>>
>>>


-- 
Best regards,
Ivan Pavlukhin

Re: How to run a job every 5 seconds in Ignite

Posted by Lokesh Sharma <lo...@gmail.com>.
Is it possible to run the job every few seconds? As far as I know, cron API
doesn't support scheduling in seconds.

On Tue, Aug 28, 2018 at 11:27 AM Lokesh Sharma <lo...@gmail.com>
wrote:

> This is what I was looking for. Many thanks!
>
> On Mon, Aug 27, 2018 at 3:01 PM Evgenii Zhuravlev <
> e.zhuravlev.wk@gmail.com> wrote:
>
>> Hi Lokesh,
>>
>> I'd suggest to start Ignite service, which will guarantee failover-safety
>> for you: https://apacheignite.readme.io/docs/service-grid. Just choose
>> cluster-singleton to make sure that you will have 1 instance of Service in
>> cluster. Inside this service you can use ignite-scheduler:
>> https://apacheignite.readme.io/docs/cron-based-scheduling, it has
>> cron API.
>>
>> Evgenii
>>
>> пн, 27 авг. 2018 г. в 9:16, Lokesh Sharma <lo...@gmail.com>:
>>
>>> I'm using Ignite with Spring Boot. Is there a way to run a job every 5
>>> seconds on exactly one node of the cluster (which could be any node)?
>>>
>>> Thank You
>>>
>>

Re: How to run a job every 5 seconds in Ignite

Posted by Lokesh Sharma <lo...@gmail.com>.
This is what I was looking for. Many thanks!

On Mon, Aug 27, 2018 at 3:01 PM Evgenii Zhuravlev <e....@gmail.com>
wrote:

> Hi Lokesh,
>
> I'd suggest to start Ignite service, which will guarantee failover-safety
> for you: https://apacheignite.readme.io/docs/service-grid. Just choose
> cluster-singleton to make sure that you will have 1 instance of Service in
> cluster. Inside this service you can use ignite-scheduler:
> https://apacheignite.readme.io/docs/cron-based-scheduling, it has
> cron API.
>
> Evgenii
>
> пн, 27 авг. 2018 г. в 9:16, Lokesh Sharma <lo...@gmail.com>:
>
>> I'm using Ignite with Spring Boot. Is there a way to run a job every 5
>> seconds on exactly one node of the cluster (which could be any node)?
>>
>> Thank You
>>
>

Re: How to run a job every 5 seconds in Ignite

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi Lokesh,

I'd suggest to start Ignite service, which will guarantee failover-safety
for you: https://apacheignite.readme.io/docs/service-grid. Just choose
cluster-singleton to make sure that you will have 1 instance of Service in
cluster. Inside this service you can use ignite-scheduler:
https://apacheignite.readme.io/docs/cron-based-scheduling, it has cron API.

Evgenii

пн, 27 авг. 2018 г. в 9:16, Lokesh Sharma <lo...@gmail.com>:

> I'm using Ignite with Spring Boot. Is there a way to run a job every 5
> seconds on exactly one node of the cluster (which could be any node)?
>
> Thank You
>