You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by chandrika <ch...@gmail.com> on 2017/08/27 12:07:29 UTC

Cron expression in agnite-schedulers

Hello All,

so far we had a good experience with ignite and we are using
ignite-scheduler in our project.
Cron expression is used for scheduling the task as given below:

SchedulerFuture<?> fut = ignite.scheduler().scheduleLocal(
                new Callable<Integer>() {
                    private int invocations;

                    @Override public Integer call() {
                        invocations++;
                        ignite.compute().broadcast(
                            new IgniteRunnable() {
                                @Override public void run() {
                                      //TODO task to be executed is coded
here
                                         .......
                                         .......
                                      }
                            }
                        );

                        return invocations;
                    }
                },
               "*/1 * * * *");

With the above cron expression it is working fine but when wanted to give
exact date and time as in * */1 18 27 8 ? 2017 (27th august , 2017 at 6:00
pm) then we are unable to schedule using apache-ignite-scheduler. The above
cron is a valid cron expression.
please let me know whether i am going in the right direction or not. If not
could you please guide me through.

Thanks and regards,
chandrika





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cron-expression-in-agnite-schedulers-tp16433.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Cron expression in agnite-schedulers

Posted by luqmanahmad <lu...@gmail.com>.
Underneath Ignite uses cron4j to schedule tasks on each node, and looking at
your patter it is not compatible with it. You can refer to [1] for more
information about the schedule patterns.

Anyway your pattern would be something like : 00 18 27 8 *

You can also validate on using [2]

[1]  http://www.sauronsoftware.it/projects/cron4j/manual.php#p02
<http://www.sauronsoftware.it/projects/cron4j/manual.php#p02>  
[2]  https://crontab.guru/ <https://crontab.guru/#00_18_27_8_*>  

-Luqman



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cron-expression-in-agnite-schedulers-tp16433p16434.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.