Skip to content

Commit b57b012

Browse files
committed
README updated
1 parent b8670c4 commit b57b012

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

README.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
ShedLock [![Build Status](https://travis-ci.org/lukas-krecan/ShedLock.png?branch=master)](https://travis-ci.org/lukas-krecan/ShedLock) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.javacrumbs.shedlock/shedlock-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.javacrumbs.shedlock/shedlock-parent)
22
========
33

4-
You have a simple Spring scheduler which works great until you need to run the application
5-
on multiple instances. Now what? You want to execute your tasks only once. You can use Quartz,
6-
but it's incredibly complex. You can use environment variable to determine a "scheduler master",
7-
but what if it dies? Or you can use ShedLock.
8-
9-
ShedLock does one and only thing. It makes sure your tasks ar executed at most once. It coordinates
4+
ShedLock does one and only thing. It makes sure your scheduled tasks ar executed at most once. It coordinates
105
cluster nodes using shared database. If a task is being executed on one node, it acquires a lock which
11-
prevents execution of the same task from another node (or thread). Please note, that **if one task is already running
12-
execution from another node does not wait, it is simply skipped**.
6+
prevents execution of the same task from another node (or thread). Please note, that **if one task is already being
7+
executed on one node, execution on other nodes does not wait, it is simply skipped**.
138

14-
Currently, only Spring scheduled tasks coordinated through Mongo or JDBC database are supported. More
9+
Currently, only Spring scheduled tasks coordinated through Mongo, JDBC database or ZooKeeper are supported. More
1510
scheduling and coordination mechanisms and expected in the future.
1611

1712
Feedback and pull-requests welcome!
@@ -23,7 +18,7 @@ Feedback and pull-requests welcome!
2318
<dependency>
2419
<groupId>net.javacrumbs.shedlock</groupId>
2520
<artifactId>shedlock-spring</artifactId>
26-
<version>0.4.1</version>
21+
<version>0.5.0</version>
2722
</dependency>
2823
```
2924

@@ -78,7 +73,7 @@ Import the project
7873
<dependency>
7974
<groupId>net.javacrumbs.shedlock</groupId>
8075
<artifactId>shedlock-provider-mongo</artifactId>
81-
<version>0.4.1</version>
76+
<version>0.5.0</version>
8277
</dependency>
8378
```
8479

@@ -118,7 +113,7 @@ Add dependency
118113
<dependency>
119114
<groupId>net.javacrumbs.shedlock</groupId>
120115
<artifactId>shedlock-provider-jdbc-template</artifactId>
121-
<version>0.4.1</version>
116+
<version>0.5.0</version>
122117
</dependency>
123118
```
124119

@@ -144,7 +139,7 @@ For those who do not want to use jdbc-template, there is plain JDBC lock provide
144139
<dependency>
145140
<groupId>net.javacrumbs.shedlock</groupId>
146141
<artifactId>shedlock-provider-jdbc</artifactId>
147-
<version>0.4.1</version>
142+
<version>0.5.0</version>
148143
</dependency>
149144
```
150145

@@ -160,7 +155,27 @@ public LockProvider lockProvider(DataSource dataSource) {
160155
return new JdbcLockProvider(dataSource);
161156
}
162157
```
163-
the rest is the same as with JdbcTemplate lock provider.
158+
the rest is the same as with JdbcTemplate lock provider.
159+
160+
#### ZooKeeper (using Curator)
161+
Import
162+
```xml
163+
<dependency>
164+
<groupId>net.javacrumbs.shedlock</groupId>
165+
<artifactId>shedlock-provider-zookeeper-curator</artifactId>
166+
<version>0.5.0</version>
167+
</dependency>
168+
```
169+
170+
and configure
171+
172+
```java
173+
@Bean
174+
public LockProvider lockProvider(org.apache.curator.framework.CuratorFramework client) {
175+
return new ZookeeperCuratorLockProvider(client);
176+
}
177+
```
178+
By default, ephemeral nodes for locks will be created under `/shedlock` node.
164179

165180
### Spring XML configuration
166181

@@ -199,6 +214,9 @@ public void run() {
199214

200215

201216
##Change log
217+
## 0.5.0
218+
1. ZooKeeper nodes created under /shedlock by default
219+
202220
## 0.4.1
203221
1. JdbcLockProvider insert does not fail on DataIntegrityViolationException
204222

0 commit comments

Comments
 (0)