java - Spring Boot : Getting @Scheduled cron value from database -


i'm using spring boot , have issues scheduling cron task using values existing in database.

for time being, i'm reading values properties file below :

@scheduled(cron= "${time.export.cron}") public void performjob() throws exception {    // } 

this works nicely, instead of getting values properties file, want them database table. possible , how ?

to achieve goals must configure scheduler @ runtime. means need use more low-level scheduler api. precisely when have prepared connect database can configure scheduler. think need rid of using @scheduled annotation , manully manage scheduler.

i think these topics can describe mean:

  1. how change spring's @scheduled fixeddelay @ runtime

  2. scheduling job spring programmatically (with fixedrate set dynamically)

however can use wild approaches intercept bean creation , replace original annotation on annotation custom metadata in order implement must know many framework details , how @scheduled annatation processor works.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -