I have feature togglz in my spring boot application. There are some features which are successfully work for the moment. So now I need to do some operation right in the time when one of my feature is activated. Is there any way to do that?
Asked
Active
Viewed 114 times
2 Answers
0
By using Spring Scheduling you can resolve your problem.
step 1: Enable scheduling for this annotation @EnableScheduling at class level
step 2: You can use any pattern like, hourly, minute, fixed delay,..etc.
@Scheduled(fixedRate = 10000)
@Scheduled(cron = "0 * * * * MON-FRI")`enter code here`
void checTogglzk() {
// ...
}
![](../../users/profiles/11095934.webp)
ranjith
- 369
- 1
- 9
-
Not really what I want to do. I need to call my method only once at day when my feature actually will be activated. – Aslan Almaniyazov Nov 15 '19 at 07:26
0
I would implement Custom ActivationStrategy and call your method within it. Example how to do it in toggz doc: https://www.togglz.org/documentation/activation-strategies.html
![](../../users/profiles/599033.webp)
David Levin
- 344
- 1
- 8