From 2ff42bcf16d6be6ab1a4149720056913561dba00 Mon Sep 17 00:00:00 2001 From: Sieun Lee Date: Sun, 6 Jul 2025 16:20:00 +0900 Subject: [PATCH 1/2] Polish AsciiDoc source block syntax Signed-off-by: Sieun Lee --- spring-batch-docs/modules/ROOT/pages/whatsnew.adoc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-batch-docs/modules/ROOT/pages/whatsnew.adoc b/spring-batch-docs/modules/ROOT/pages/whatsnew.adoc index 22635de973..0f23d6bd1a 100644 --- a/spring-batch-docs/modules/ROOT/pages/whatsnew.adoc +++ b/spring-batch-docs/modules/ROOT/pages/whatsnew.adoc @@ -41,7 +41,8 @@ This implementation requires MongoDB version 4 or later and is based on Spring D In order to use this job repository, all you need to do is define a `MongoTemplate` and a `MongoTransactionManager` which are required by the newly added `MongoJobRepositoryFactoryBean`: -``` +[source, java] +---- @Bean public JobRepository jobRepository(MongoTemplate mongoTemplate, MongoTransactionManager transactionManager) throws Exception { MongoJobRepositoryFactoryBean jobRepositoryFactoryBean = new MongoJobRepositoryFactoryBean(); @@ -50,7 +51,7 @@ public JobRepository jobRepository(MongoTemplate mongoTemplate, MongoTransaction jobRepositoryFactoryBean.afterPropertiesSet(); return jobRepositoryFactoryBean.getObject(); } -``` +---- Once the MongoDB job repository defined, you can inject it in any job or step as a regular job repository. 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. A `CompositeItemReader` works like other composite artifacts, by delegating the reading operation to regular item readers in order. Here is a quick example showing a composite reader that reads persons data from a flat file then from a database table: -``` +[source, java] +---- @Bean public FlatFileItemReader itemReader1() { return new FlatFileItemReaderBuilder() @@ -112,7 +114,7 @@ public JdbcCursorItemReader itemReader2() { public CompositeItemReader itemReader() { return new CompositeItemReader<>(Arrays.asList(itemReader1(), itemReader2())); } -``` +---- [[new-adapters-for-java-util-function-apis]] == New adapters for java.util.function APIs From 31a8ded81d9327ff9528e2203fcf3b3f056c031b Mon Sep 17 00:00:00 2001 From: Sieun Lee Date: Sun, 6 Jul 2025 16:20:46 +0900 Subject: [PATCH 2/2] Fix typo in whatsnew.adoc Signed-off-by: Sieun Lee --- spring-batch-docs/modules/ROOT/pages/whatsnew.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-batch-docs/modules/ROOT/pages/whatsnew.adoc b/spring-batch-docs/modules/ROOT/pages/whatsnew.adoc index 0f23d6bd1a..2162223f15 100644 --- a/spring-batch-docs/modules/ROOT/pages/whatsnew.adoc +++ b/spring-batch-docs/modules/ROOT/pages/whatsnew.adoc @@ -119,7 +119,7 @@ public CompositeItemReader itemReader() { [[new-adapters-for-java-util-function-apis]] == New adapters for java.util.function APIs -Similar to `FucntionItemProcessor` that adapts a `java.util.function.Function` to an item processor, this release +Similar to `FunctionItemProcessor` that adapts a `java.util.function.Function` to an item processor, this release introduces several new adapters for other `java.util.function` interfaces like `Supplier`, `Consumer` and `Predicate`. The newly added adapters are: `SupplierItemReader`, `ConsumerItemWriter` and `PredicateFilteringItemProcessor`.