Shedlock dynamic lock name template interpolation

138 views Asked by At

I need to use method parameters as part of the lock name.

  @SchedulerLock(name = "my-job-#{tenantId}-#{date}")
  public void job(UUID tenantId, LocalDate date) {

  }
1

There are 1 answers

0
Hadi Mansouri On

If you use an updated library the correct syntax is:

  @SchedulerLock(name = "my-job-#{#tenantId + '-' + #date}")
  public void job(UUID tenantId, LocalDate date) {

  }