0

My application is using spring 4.0.0. I'm trying to write a scheduler in a distributed system. My application is working on multiple servers and my database is also running at multiple servers.

I'm trying to achieve: My scheduler will run on one server only.

I tried two approaches:

  1. Profiling: Make a different profile and deploy it in any server.

    But I don't want a different-different profile for different-different servers.

  2. Shedlock

    Shedlock does not support spring 4xx version.

Kindly suggest a better approach

James Z
  • 12,209
  • 10
  • 24
  • 44
Ampil
  • 1
  • 2
  • So basically the solution you should be using, profiles or external configuration is the one you don't want to use. – M. Deinum Jul 21 '20 at 06:24
  • yes, @M.Deinum I don't want to depend on multiple configurations. – Ampil Jul 21 '20 at 06:31
  • You don't have to. You can have it depend on a single property which can be set in the environment. Basically disable jobs by default only enable when this property is set to `true` (or something along those lines). The same would work for profiles, enable only when a certain profile is active. You don't have to have seperate configuration just enable an additional profile. That is what it is designed for. – M. Deinum Jul 21 '20 at 06:37
  • So According to you just add a new separate configuration say "conf File 2".deploy all with previous conf file (say conf 1) and in one server deploy with conf1 + conf2. Am I right?? – Ampil Jul 21 '20 at 07:15
  • No that isn't what I'm saying. Deploy everything with the same configuration and override 1 property (or enable a profile) to switch on tasks. You don't need seperate config files. – M. Deinum Jul 21 '20 at 07:38

1 Answers1

0

You can use old version of ShedLock https://github.com/lukas-krecan/ShedLock/issues/299

Lukas
  • 13,606
  • 9
  • 31
  • 40