• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring Scheduler

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a Spring Batch job which I am triggering from a Spring Scheduler service running in Tomcat..

Java code..



XML...



My question is it a good idea to have "(fixedRate = 14400000)" hard coded in Java? Supposing we need to change the schedule on which the job runs or not to have the job run on a given day? Is there a better design to get around these restrictions?

Thanks.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well if its not going to change often I suppose its fine You can use a PropertySourcesPlaceholderConfigurer to load the value from a properties file and use SPEL to put it in.



Of course that is where it is expecting a String with yours I think it wants a long. It might do the type conversion for you, try it. If it does not you can get more creative with your SPeL and call the Long.valueOf() method on your property.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic