Prasad Nayak
Prasad Nayak

Reputation: 3

How can I pass cron and timezone dynamically. #Spring Scheduler

How can I pass cron and timezone dynamically in Spring Schedular

Upvotes: 0

Views: 321

Answers (2)

abhinavsinghvirsen
abhinavsinghvirsen

Reputation: 2024

you can do it by passing corn expression from properties file

@Scheduled(cron = "${cron.expression}")
    public void methodServicesDemo()
    {
        System.out.println("Method execute  :: "+ new Date());
    }

Upvotes: 1

Related Questions