Skip to content

Commit 7095314

Browse files
committed
update doc
1 parent 153a585 commit 7095314

File tree

2 files changed

+65
-42
lines changed

2 files changed

+65
-42
lines changed

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Secondary goal is to support [Poor mans Workflow](https://github.com/sterlp/pmw)
1010

1111
# Setup and Run a Task
1212

13-
- [JavaDoc](https://sterlp.github.io/spring-persistent-tasks/javadoc-core/)
13+
- [JavaDoc](https://sterlp.github.io/spring-persistent-tasks/javadoc-core/org/sterl/spring/persistent_tasks/PersistentTaskService.html)
1414

1515
## Maven
1616

17-
- [Maven Central spring-persistent-tasks-core](https://central.sonatype.com/artifact/org.sterl.spring/spring-persistent-tasks-core/versions)
17+
- [Maven Central spring-persistent-tasks-core](https://central.sonatype.com/artifact/org.sterl.spring/spring-persistent-tasks-core/versions)
1818

1919
```xml
2020
<dependency>
@@ -32,9 +32,10 @@ Secondary goal is to support [Poor mans Workflow](https://github.com/sterlp/pmw)
3232
public class ExampleApplication {
3333
```
3434

35-
## Setup a spring persitent task
35+
## Setup a spring persistent task
3636

3737
### As a class
38+
3839
```java
3940
@Component(BuildVehicleTask.NAME)
4041
@RequiredArgsConstructor
@@ -43,7 +44,7 @@ public class BuildVehicleTask implements SpringBeanTask<Vehicle> {
4344

4445
private static final String NAME = "buildVehicleTask";
4546
public static final TaskId<Vehicle> ID = new TaskId<>(NAME);
46-
47+
4748
private final VehicleRepository vehicleRepository;
4849

4950
@Transactional(timeout = 5)
@@ -58,7 +59,7 @@ public class BuildVehicleTask implements SpringBeanTask<Vehicle> {
5859

5960
### As a closure
6061

61-
Note: this example has no aspects as above the spring *@Transactional*
62+
Note: this example has no aspects as above the spring _@Transactional_
6263

6364
```java
6465
@Bean
@@ -85,6 +86,7 @@ SpringBeanTask<Vehicle> task1(VehicleRepository vehicleRepository) {
8586
```
8687

8788
### Build Trigger
89+
8890
```java
8991
private final TriggerService triggerService;
9092

@@ -113,18 +115,33 @@ SpringBeanTask<Vehicle> task1(VehicleRepository vehicleRepository) {
113115
}
114116
```
115117

118+
### Spring configuration options
119+
120+
| Property | Type | Description | Default Value |
121+
| ---------------------------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------- | ------------- |
122+
| `spring.persistent-tasks.poll-rate` | `java.lang.Integer` | The interval at which the scheduler checks for new tasks, in seconds. | - |
123+
| `spring.persistent-tasks.max-threads` | `java.lang.Integer` | The number of threads to use; default is 10; set to 0 to disable task processing. | `10` |
124+
| `spring.persistent-tasks.task-timeout` | `java.time.Duration` | The maximum time allowed for a task and scheduler to complete a task. Defaults to 5 minutes. | - |
125+
| `spring.persistent-tasks.poll-task-timeout` | `java.lang.Integer` | The interval at which the system checks for abandoned tasks, in seconds. Defaults to every 5 minutes. | - |
126+
| `spring.persistent-tasks.history.delete-after` | `java.lang.Integer` | The interval at which old triggers are deleted, in seconds. Defaults to every 72 hours. | - |
127+
| `spring.persistent-tasks.scheduler-enabled` | `java.lang.Boolean` | Indicates whether this node should handle triggers. | `true` |
128+
116129
# Setup DB with Liquibase
117130

118131
Liquibase is supported. Either import all or just the required versions.
119132

120133
## Maven
121-
- [Maven Central spring-persistent-tasks-db](https://central.sonatype.com/artifact/org.sterl.spring/spring-persistent-tasks-db/versions)
134+
135+
- [Maven Central spring-persistent-tasks-db](https://central.sonatype.com/artifact/org.sterl.spring/spring-persistent-tasks-db/versions)
122136

123137
## Option 1: Just include the master file
138+
124139
```xml
125140
<include file="spring-persistent-tasks/db.changelog-master.xml" />
126141
```
142+
127143
## Option 2: import changesets on by one
144+
128145
```xml
129146
<include file="spring-persistent-tasks/db/pt-changelog-v1.xml" />
130147
```
@@ -133,7 +150,7 @@ Liquibase is supported. Either import all or just the required versions.
133150

134151
## Maven
135152

136-
- [Maven Central spring-persistent-tasks-ui](https://central.sonatype.com/artifact/org.sterl.spring/spring-persistent-tasks-ui/versions)
153+
- [Maven Central spring-persistent-tasks-ui](https://central.sonatype.com/artifact/org.sterl.spring/spring-persistent-tasks-ui/versions)
137154

138155
```xml
139156
<dependency>
@@ -154,19 +171,22 @@ public class ExampleApplication {
154171

155172
## Open the UI
156173

157-
- http://localhost:8080/task-ui
174+
- http://localhost:8080/task-ui
158175

159176
## Schedulers
177+
160178
![Schedulers](screenshots/schedulers-screen.png)
161179

162180
## Triggers
181+
163182
![Triggers](screenshots/triggers-screen.png)
164183

165184
## History
185+
166186
![History](screenshots/history-screen.png)
167187

168188
# Alternatives
169189

170-
- quartz
171-
- db-scheduler
172-
- jobrunr
190+
- quartz
191+
- db-scheduler
192+
- jobrunr
Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
{"properties": [{
2-
"name": "spring.persistent-tasks.poll-rate",
3-
"type": "java.lang.Integer",
4-
"description": "The rate in which the scheduler should check for new tasks."
5-
},
61
{
7-
"name": "spring.persistent-tasks.max-threads",
8-
"type": "java.lang.Integer",
9-
"description": "The amount of threads to use, use 0 to disable the task processing."
10-
},
11-
{
12-
"name": "spring.persistent-tasks.task-timeout",
13-
"type": "java.time.Duration",
14-
"description": "The amount of time a task and scheduler has time to finish a task in seconds, default 5min."
15-
},
16-
{
17-
"name": "spring.persistent-tasks.poll-task-timeout",
18-
"type": "java.lang.Integer",
19-
"description": "How often the system should check for abandond tasks in seconds, default every 5min."
20-
},
21-
{
22-
"name": "spring.persistent-tasks.clean-trigger-rate",
23-
"type": "java.lang.Integer",
24-
"description": "How often old triggers should be deleted in seconds, default every 2hours."
25-
},
26-
{
27-
"name": "spring.persistent-tasks.scheduler-enabled",
28-
"type": "java.lang.Boolean",
29-
"description": "If this node should handle any triggers or not.",
30-
"defaultValue": true
31-
}
32-
]}
2+
"properties": [
3+
{
4+
"name": "spring.persistent-tasks.poll-rate",
5+
"type": "java.lang.Integer",
6+
"description": "The interval at which the scheduler checks for new tasks in seconds."
7+
},
8+
{
9+
"name": "spring.persistent-tasks.max-threads",
10+
"type": "java.lang.Integer",
11+
"description": "The number of threads to use; default 10; set to 0 to disable task processing."
12+
},
13+
{
14+
"name": "spring.persistent-tasks.task-timeout",
15+
"type": "java.time.Duration",
16+
"description": "The maximum time allowed for a task and scheduler to complete a task. Defaults to 5 minutes."
17+
},
18+
{
19+
"name": "spring.persistent-tasks.poll-task-timeout",
20+
"type": "java.lang.Integer",
21+
"description": "The interval at which the system checks for abandoned tasks, in seconds. Defaults to every 5 minutes."
22+
},
23+
{
24+
"name": "spring.persistent-tasks.history.delete-after",
25+
"type": "java.lang.Integer",
26+
"description": "The interval at which old triggers are deleted, in seconds. Defaults to every 72 hours."
27+
},
28+
{
29+
"name": "spring.persistent-tasks.scheduler-enabled",
30+
"type": "java.lang.Boolean",
31+
"description": "Indicates whether this node should handle triggers.",
32+
"defaultValue": true
33+
}
34+
]
35+
}

0 commit comments

Comments
 (0)