Questions tagged [shedlock]

ShedLock assures that scheduled tasks are executed at most once at the same time.

ShedLock makes sure that scheduled tasks are executed at most once at the same time. If a task is being executed on one node, it acquires a lock which prevents execution of the same task from another node (or thread). If task is already being executed on one node, execution on other nodes does not wait, it is simply skipped.

ShedLock uses external store like Mongo, JDBC database, Redis, Hazelcast, ZooKeeper or anything with a JDBC driver.

https://github.com/lukas-krecan/ShedLock

https://www.baeldung.com/shedlock-spring

66 questions
0
votes
1 answer

Implementing Shedlock in Spring Boot using Redis Cache (Jedis resource Pool)

I am trying to implement shedlock in a Java Spring Boot application using redis. In every resource I search for it is mentioned that shedlock is compatible with Redis, however I couldn't find how to implement the same. Could someone please help me…
Sreeram R
  • 11
  • 1
0
votes
0 answers

Spring boot shedlock runs two tasks on several instances

We started using ShedLock and need to run two tasks once a day. Therefore, I defined two tasks with different lock names in one class (so that they could run simultaneously). Execution start time I set the same for booth jobs. But for some reason,…
ssa
  • 1
  • 1
0
votes
1 answer

SpringBoot shedlock Without time Interval

I am running Spring boot application with 2 instances.Here i am going to use scheduler to run my application.For avoiding Scheduler not to run in two instances at same time using schlock .but schlock i have to mention for atleastfor or atmostfor…
0
votes
1 answer

shedlock getting lock status by lockname

I am using a rest endpoint to start a java process using executeWithLock which takes in a LockingTaskExecutor.TaskWithResult(call method of TaskWithResult calls the java process/method). This works fine and it allows only single execution of java…
0
votes
0 answers

Shedlock is not scheduling the task

I am trying to use Shedlock for running scheduled task in a clustered environment. But the moment I add @EnableSchedulerLock annotation, the scheduler task does not start at all. I see that I need to provide LockProvider. I am using Redis/Lettuce in…
user1805280
  • 251
  • 1
  • 5
  • 14
0
votes
1 answer

Spring ShedLock in xml based configuration

I've a legacy code base and need to implement Spring Shedlock I found many article like shedlock-spring but my scheduler is already written in xml configuration.
ErShakirAnsari
  • 653
  • 7
  • 19
0
votes
2 answers

Is it necessary to set LockAtMostFor and LockAtLeastFor?

Whether it is necessary to set values LockAtMostFor and LockAtMostFor for a task that is executed once a month, the execution time is several minutes, there are several nodes with a running service. How correct will it be to expose values…
sdkdan
  • 13
  • 2
  • 5
0
votes
1 answer

ShedLock virsion 4.20.1- Unexpected error occurred in scheduled task NoClassDefFoundError ClockProvider

I'm using Shedlock with oracle DB,i followed this documentation https://github.com/lukas-krecan/ShedLock I also added the 5th column " now TIMESTAMP(3) NULL," to the table after the exception. Its the only instance running currently. this is my…
Tai Levi
  • 1
  • 1
0
votes
1 answer

How to use ShedLock in Spring Integration?

I am combining the Spring Batch and Spring Integration, I am using the poller with a corn: @Bean @SchedulerLock(name = "importEntitiesRiskCodes", lockAtMostForString = "PT5M") public IntegrationFlow integrationFlow() { return…
0
votes
3 answers

Unable to create a LockManager bean in ShedLock

I have a custom ThreadPoolTaskScheduler which I want to use in LockableTaskScheduler instance I defined in the config as below: @Configuration public class ApplicationConfiguration { @Autowired DataSource dataSource; @Bean public…
Bere
  • 1,627
  • 2
  • 16
  • 22
0
votes
1 answer

Java Spring shedlock fails

i have a spring-boot app, which on production environment runs in 2 instances, resulting in scheduled tasks running twice. to avoid that i'm trying use shedlock, as explained here and here, but it has no affect. i'm already using a MySql db, to…
eRez
  • 257
  • 8
  • 24
0
votes
1 answer

About Scheduler at Spring 4xx Version

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…
Ampil
  • 1
  • 2
0
votes
1 answer

How do I resolve this codec error when using Shedlock with mongo

Hi I am trying to use Shedlock for Spring Boot Mongo. The docs said it required Mongo JAva 3.7.0. I am currently using Spring spring-boot-starter-parent v 2.0.4, which had an older version of the driver, so upgraded to version 2.1.0. Below is the…
qwertyqwerty
  • 207
  • 5
  • 15
0
votes
1 answer

How to dependency-inject CqlSession?

In order to use ShedLock with Cassandra, I need the CqlSession to create a CassandraLockProvider, according to the docs. However, I always get the following error: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean…
Tobias Hermann
  • 9,936
  • 6
  • 61
  • 134
0
votes
1 answer

Shedlock to pick certain servers only

I have implemented shedlock for my application which works fine without any issues for the two servers we have. We now have two new servers added on a different domain, and the shedlock picks them as well. (Well, that's how its intended to be) I…
Reema
  • 587
  • 3
  • 12
  • 37