Skip to content

Commit b846b4c

Browse files
committed
add config metadata
1 parent e09fad5 commit b846b4c

File tree

5 files changed

+91
-10
lines changed

5 files changed

+91
-10
lines changed

batch-web-spring-boot-autoconfigure/src/main/java/de/codecentric/batch/configuration/BatchWebAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
*/
6262
@Configuration
6363
@EnableBatchProcessing(modular = true)
64-
@PropertySource("classpath:spring-boot-starter-batch-web.properties")
64+
@PropertySource("classpath:batch-web-spring-boot-autoconfigure.properties")
6565
@AutoConfigureAfter({ MetricsAutoConfiguration.class })
6666
@Import({ WebConfig.class, TaskExecutorBatchConfigurer.class, AutomaticJobRegistrarConfiguration.class,
6767
BaseConfiguration.class, Jsr352BatchConfiguration.class, MetricsConfiguration.class,

batch-web-spring-boot-autoconfigure/src/main/java/de/codecentric/batch/configuration/WebConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.http.converter.HttpMessageConverter;
2727
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
28-
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
28+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
2929

3030
import de.codecentric.batch.web.JobMonitoringController;
3131
import de.codecentric.batch.web.JobOperationsController;
@@ -39,7 +39,7 @@
3939
*
4040
*/
4141
@Configuration
42-
public class WebConfig extends WebMvcConfigurerAdapter {
42+
public class WebConfig implements WebMvcConfigurer {
4343

4444
@Autowired
4545
private BaseConfiguration baseConfig;
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"properties": [
3+
{
4+
"name": "batch.web.operations.base",
5+
"type": "java.lang.String",
6+
"description": "URL part to operational methods on batch jobs, like starting, stopping, etc. of jobs",
7+
"default": "/batch/operations"
8+
},
9+
{
10+
"name": "batch.web.monitoring.base",
11+
"type": "java.lang.String",
12+
"description": "URL part to monitoring methods on batch jobs, like viewing the state of jobs",
13+
"default": "/batch/monitoring"
14+
},
15+
{
16+
"name": "batch.config.path.xml",
17+
"type": "java.lang.String",
18+
"description": "Location in the classpath where Spring Batch job definitions in XML are picked up",
19+
"default": "spring.batch.jobs"
20+
},
21+
{
22+
"name": "batch.config.package.javaconfig",
23+
"type": "java.lang.String",
24+
"description": "Package where Spring Batch job definitions in JavaConfig are picked up",
25+
"default": "spring.batch.jobs"
26+
},
27+
{
28+
"name": "batch.defaultprotocol.enabled",
29+
"type": "java.lang.Boolean",
30+
"description": "Whether the default job protocol printed into the log is activated",
31+
"default": true
32+
},
33+
{
34+
"name": "batch.logfileseparation.enabled",
35+
"type": "java.lang.Boolean",
36+
"description": "Whether writing one log file for each job execution is activated",
37+
"default": true
38+
},
39+
{
40+
"name": "batch.metrics.enabled",
41+
"type": "java.lang.Boolean",
42+
"description": "Whether the transaction safe batch metrics framework is activated so that BatchMetrics may be injected and used",
43+
"default": false
44+
},
45+
{
46+
"name": "batch.metrics.profiling.readprocesswrite.enabled",
47+
"type": "java.lang.Boolean",
48+
"description": "Readers, Processors and Writers are profiled with RichGauges when set to true",
49+
"default": false
50+
},
51+
{
52+
"name": "batch.core.pool.size",
53+
"type": "java.lang.Integer",
54+
"description": "Core pool size of the thread pool",
55+
"default": 5
56+
},
57+
{
58+
"name": "batch.queue.capacity",
59+
"type": "java.lang.Integer",
60+
"description": "Queue capacity of the task executor",
61+
"default": "Integer.MAX_VALUE"
62+
},
63+
{
64+
"name": "batch.max.pool.size",
65+
"type": "java.lang.Integer",
66+
"description": "Max pool size of the thread pool",
67+
"default": "Integer.MAX_VALUE"
68+
},
69+
{
70+
"name": "batch.repository.isolationlevelforcreate",
71+
"type": "java.lang.String",
72+
"description": "Database isolation level for creating job executions",
73+
"default": "Spring Batch’s default"
74+
},
75+
{
76+
"name": "batch.repository.tableprefix",
77+
"type": "java.lang.String",
78+
"description": "Prefix for Spring Batch meta data tables"
79+
}
80+
]
81+
}

batch-web-spring-boot-autoconfigure/src/main/resources/spring-boot-starter-batch-web.properties renamed to batch-web-spring-boot-autoconfigure/src/main/resources/batch-web-spring-boot-autoconfigure.properties

File renamed without changes.

batch-web-spring-boot-docs/src/main/asciidoc/index.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Default port is 8080. Take a look at the JavaDoc of these controllers to get to
5252

5353
== Configuration options
5454

55-
There are two ways to influence spring-boot-starter-batch-web's behaviour. The first way is to set certain properties, the second way is to add certain components to the ApplicationContext. Let's take a look at the available properties first. Note that these are only the properties of spring-boot-starter-batch-web, there are more properties from Spring Boot described in the Spring Boot reference documentation.
55+
There are two ways to influence batch-web-spring-boot-starter's behaviour. The first way is to set certain properties, the second way is to add certain components to the ApplicationContext. Let's take a look at the available properties first. Note that these are only the properties of batch-web-spring-boot-starter, there are more properties from Spring Boot described in the Spring Boot reference documentation.
5656

5757
|===
5858
|Property name |Description |Default value
@@ -61,23 +61,23 @@ There are two ways to influence spring-boot-starter-batch-web's behaviour. The f
6161
|Location in the classpath where Spring Batch job definitions in XML are picked up.
6262
|/META-INF/spring/batch/jobs
6363

64-
|batch.config. package.javaconfig
64+
|batch.config.package.javaconfig
6565
|Package where Spring Batch job definitions in JavaConfig are picked up.
6666
|spring.batch.jobs
6767

68-
|batch.defaultprotocol. enabled
68+
|batch.defaultprotocol.enabled
6969
|Whether the default job protocol printed into the log is activated.
7070
|true
7171

72-
|batch.logfileseparation. enabled
72+
|batch.logfileseparation.enabled
7373
|Whether writing one log file for each job execution is activated.
7474
|true
7575

7676
|batch.metrics.enabled
7777
|Whether the transaction safe batch metrics framework is activated so that BatchMetrics may be injected and used.
7878
|false
7979

80-
|batch.metrics.profiling. readprocesswrite.enabled
80+
|batch.metrics.profiling.readprocesswrite.enabled
8181
|Readers, Processors and Writers are profiled with RichGauges when set to true.
8282
|false
8383

@@ -93,11 +93,11 @@ There are two ways to influence spring-boot-starter-batch-web's behaviour. The f
9393
|Max pool size of the thread pool.
9494
|Integer.MAX_VALUE
9595

96-
|batch.repository. isolationlevelforcreate
96+
|batch.repository.isolationlevelforcreate
9797
|Database isolation level for creating job executions.
9898
|Spring Batch’s default
9999

100-
|batch.repository. tableprefix
100+
|batch.repository.tableprefix
101101
|Prefix for Spring Batch meta data tables.
102102
|Not set
103103

0 commit comments

Comments
 (0)