You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-batch-docs/modules/ROOT/pages/whatsnew.adoc
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,8 @@ This implementation requires MongoDB version 4 or later and is based on Spring D
41
41
In order to use this job repository, all you need to do is define a `MongoTemplate` and a
42
42
`MongoTransactionManager` which are required by the newly added `MongoJobRepositoryFactoryBean`:
43
43
44
-
```
44
+
[source, java]
45
+
----
45
46
@Bean
46
47
public JobRepository jobRepository(MongoTemplate mongoTemplate, MongoTransactionManager transactionManager) throws Exception {
47
48
MongoJobRepositoryFactoryBean jobRepositoryFactoryBean = new MongoJobRepositoryFactoryBean();
@@ -50,7 +51,7 @@ public JobRepository jobRepository(MongoTemplate mongoTemplate, MongoTransaction
50
51
jobRepositoryFactoryBean.afterPropertiesSet();
51
52
return jobRepositoryFactoryBean.getObject();
52
53
}
53
-
```
54
+
----
54
55
55
56
Once the MongoDB job repository defined, you can inject it in any job or step as a regular job repository.
56
57
You can find a complete example in the https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/MongoDBJobRepositoryIntegrationTests.java[MongoDBJobRepositoryIntegrationTests].
@@ -85,7 +86,8 @@ over different resources and writing a custom reader is not an option.
85
86
A `CompositeItemReader` works like other composite artifacts, by delegating the reading operation to regular item readers
86
87
in order. Here is a quick example showing a composite reader that reads persons data from a flat file then from a database table:
87
88
88
-
```
89
+
[source, java]
90
+
----
89
91
@Bean
90
92
public FlatFileItemReader<Person> itemReader1() {
91
93
return new FlatFileItemReaderBuilder<Person>()
@@ -112,12 +114,12 @@ public JdbcCursorItemReader<Person> itemReader2() {
112
114
public CompositeItemReader<Person> itemReader() {
113
115
return new CompositeItemReader<>(Arrays.asList(itemReader1(), itemReader2()));
114
116
}
115
-
```
117
+
----
116
118
117
119
[[new-adapters-for-java-util-function-apis]]
118
120
== New adapters for java.util.function APIs
119
121
120
-
Similar to `FucntionItemProcessor` that adapts a `java.util.function.Function` to an item processor, this release
122
+
Similar to `FunctionItemProcessor` that adapts a `java.util.function.Function` to an item processor, this release
121
123
introduces several new adapters for other `java.util.function` interfaces like `Supplier`, `Consumer` and `Predicate`.
122
124
123
125
The newly added adapters are: `SupplierItemReader`, `ConsumerItemWriter` and `PredicateFilteringItemProcessor`.
0 commit comments