Commit Graph

5948 Commits

Author SHA1 Message Date
Mahmoud Ben Hassine
bdd2cd4b25 Update core native hints
This commit adds a:

* JDK proxy hint for JobExplorer
* Reflection hint for fields of java.sql.Types
2022-10-01 12:08:40 +02:00
Glenn Renfro
8973c8a5b6 Adapt observability code to latest changes in Micrometer 2022-10-01 11:02:25 +02:00
Mahmoud Ben Hassine
b9b7c0891a Fix formatting 2022-09-22 07:40:44 +02:00
Mahmoud Ben Hassine
39b8279831 Fix incorrect reference to SimpleJdbcTemplate in reference documentation
Resolves #4197
2022-09-22 07:11:33 +02:00
Mahmoud Ben Hassine
be231f7316 Improve the documentation of scoped beans definition
Resolves #1502
2022-09-22 06:50:52 +02:00
Mahmoud Ben Hassine
27a8ed7eb3 Move xstream.version property to test dependencies section
XStream is only used for tests, and is not an optional
production dependency. This commit moves the property
declaration to the correct section in the pom file.
2022-09-22 05:34:55 +02:00
Mahmoud Ben Hassine
76c0b0030f Update Spring dependencies to latest snapshots 2022-09-22 04:52:56 +02:00
Spring Builds
83ef59ac5e [artifactory-release] Next development version 2022-09-21 18:35:32 +00:00
Spring Builds
ba7cad4ad8 [artifactory-release] Release version 5.0.0-M6 2022-09-21 18:35:29 +00:00
Mahmoud Ben Hassine
72a6d5ddd3 Update dependencies 2022-09-21 19:51:08 +02:00
Mahmoud Ben Hassine
219fee3bad Update documentation 2022-09-21 19:51:08 +02:00
Mahmoud Ben Hassine
1141975470 Add isolationLevelForCreate attribute in EnableBatchProcessing
Related to #3942
2022-09-21 19:08:55 +02:00
Mahmoud Ben Hassine
e33659cae5 Add support to customize transaction attributes in infrastructure beans
Before this commit, the transaction attributes were hardcoded and not
configurable in the proxy created by Job explorer/repository/operator
factory beans.

This commit adds the possibility to customize the transaction attributes
in addition to the transaction manager. It is now possible to configure
the transaction's isolation level as well as its propagation for each
method if needed.

Resolves #4195
2022-09-21 10:20:57 +02:00
Mahmoud Ben Hassine
6ad3596401 Add support for transaction customization in SimpleJobOperator
This commit adds support to configure and create a transactional
proxy around SimpleJobOperator through a factory bean.

The usage of `@Transactional` was removed in favor of
the programmatic way of customizing the proxy through
the factory bean.

Resolves #1078
2022-09-21 04:34:34 +02:00
Mahmoud Ben Hassine
40b4be3c14 Add transaction support in JobExplorerFactoryBean
This commit adds support to create a transactional
proxy around the JobExplorer created by the
JobExplorerFactoryBean.

Resolves #1307
2022-09-21 03:28:59 +02:00
Mahmoud Ben Hassine
0a71cb7d93 Fix Javadoc of RemoteChunkingManagerStepBuilder 2022-09-21 02:43:42 +02:00
Mahmoud Ben Hassine
aaf22e1860 Remove bean reference checks in BatchRegistrar
These checks occur too early in the bean creation/registration
process and might cause issues when initializing the context.

Related to #3942
2022-09-20 15:35:31 +02:00
Mahmoud Ben Hassine
48e437ae17 Revisit the configuration code of EnableBatchProcessing
Before this commit, the configuration of infrastructure beans
was confusing and not straightforward to customize. This commit
changes the way Batch infrastructure beans are configured.
The most important changes are:

* EnableBatchProcessing now provides new attributes to
configure properties of infrastructure beans
* Bean registration is now done programmatically with a
BeanDefinitionRegistrar instead of importing a class with
statically annotated bean definition methods
* Bean are now resolved from the application context directly
instead of being resolved from a BatchConfigurer
* Both a data source and a transaction manager are now
required to be defined in the application context
* A new configuration class called DefaultBatchConfiguration
with default infrastructure bean definitions is now provided
and can be extended to customize the default configuration

Resolves #3942
2022-09-20 12:24:10 +02:00
Mahmoud Ben Hassine
f39f07075a Improve Step/Job builder APIs to guide users to set mandatory properties
Before this commit, the user had to manually set the job repository and transaction
manager on `JobBuilder` and `StepBuilder` instances with a chained call to
`.repository(jobRepository)` and `.transactionManager(transactionManager)`.
This is error prone and can lead to runtime errors if these properties are not set.

This commit introduces new APIs to guide the user to set these properties at
builder creation time.

Resolves #4192
2022-09-17 22:31:12 +02:00
Mahmoud Ben Hassine
d11b5b2c3a Remove BatchConfigurer#getTransactionManager
Before this commit, the transaction manager was configurable
by implementing `BatchConfigurer#getTransactionManager`.

The transaction manager being an implementation detail of the
`JobRepository`, it should not be configurable at the same level
as the `JobRepository` (ie in the same interface).

This commit removes the method `getTransactionManager` from
the `BatchConfigurer` interface. If needed, a custom transaction
manager could be supplied by implementing `getJobRepository`,
or via the constructor of `DefaultBatchConfigurer`.

Resolves https://github.com/spring-projects/spring-batch/issues/4191
2022-09-13 20:02:32 +02:00
Mahmoud Ben Hassine
6e443cb1b1 Deprecate Job/Step builder factories
This commit deprecates JobBuilderFactory and StepBuilderFactory
in favor of the respective builders they create.

It also removes the exposure of such utilities as beans in the
application context when using `@EnableBatchProcessing`.

Resolves https://github.com/spring-projects/spring-batch/issues/4188
2022-09-13 16:56:01 +02:00
Mahmoud Ben Hassine
06c2dc3a01 Refine contribution #4187
Add resource hints for all supported databases
2022-09-12 07:41:14 +02:00
Glenn Renfro
2f8668d1f8 Add native hints for Spring Batch
Issue #4187
2022-09-12 07:36:14 +02:00
Tommy Ludwig
f20942e368 Adapt to ObservationConvention location change
See https://github.com/micrometer-metrics/micrometer/pull/3387
2022-09-09 15:41:45 +02:00
Tadaya Tsuyukubo
1ff720545f Adapt SampleTestRunner change in micrometer tracing
Accommodate the breaking change in `SampleTestRunner` introduced by
https://github.com/micrometer-metrics/tracing/pull/57
2022-09-09 15:38:30 +02:00
Mahmoud Ben Hassine
7c8fb172a7 Move the transaction manager configuration to AbstractTaskletStepBuilder
Before this commit, the transaction manager was configurable
at the StepBuilder level, which is inconsistent with the XML
config style in addition to be not needed for most step types.

This commit moves the configuration of the transaction manager
from the StepBuilder down to the AbstractTaskletStepBuilder,
which is the level where the transaction manager is needed.

Resolves #4130
2022-09-08 11:35:14 +02:00
Mahmoud Ben Hassine
55af86df59 Update micrometer dependencies to latest snapshots 2022-09-07 17:05:06 +02:00
Mahmoud Ben Hassine
4d548d9a49 Exclude junit-jupiter from micrometer test dependencies 2022-09-07 17:05:06 +02:00
Mahmoud Ben Hassine
42b1b2f2c9 Put back "Replace ListenableFuture with CompletableFuture"
Related to a165247284.
2022-08-24 20:08:14 +02:00
Mahmoud Ben Hassine
bd25df6770 Put back "Fix StepScopeProxyTargetClassOverrideIntegrationTests"
Related to bbf7086765.
2022-08-24 20:07:21 +02:00
Mahmoud Ben Hassine
2f7a3943ff Update Spring dependencies to latest snapshots 2022-08-24 20:06:36 +02:00
Spring Builds
878578f829 [artifactory-release] Next development version 2022-08-24 17:14:59 +00:00
Spring Builds
7fc0af6785 [artifactory-release] Release version 5.0.0-M5 2022-08-24 17:14:56 +00:00
Mahmoud Ben Hassine
f7ca108cff Update "what's new section" for 5.0.0-M5 2022-08-24 18:28:09 +02:00
Mahmoud Ben Hassine
bbf7086765 Revert "Fix StepScopeProxyTargetClassOverrideIntegrationTests"
This reverts commit bf2e6ab0e5
as the change was made after spring-framework 6.0.0-M5 was
released. This version is required to release spring-batch
5.0.0-M5

This change will be put back after releasing 5.0.0-M5.
2022-08-24 18:11:18 +02:00
Mahmoud Ben Hassine
a165247284 Revert "Replace ListenableFuture with CompletableFuture"
This reverts commit a2cf74ad as the change was made after
spring-kafka 3.0.0-M5 was released. This version is required
to release spring-batch 5.0.0-M5

This change will be put back after releasing 5.0.0-M5.
2022-08-24 18:09:29 +02:00
Mahmoud Ben Hassine
b524e3287f Update dependencies
Update deps

Update deps2
2022-08-24 18:09:29 +02:00
Henning Poettker
6bbd9d8379 Fix non-nullable columns in MySQL migration for Spring Batch 4.3
Issue #4145
2022-08-24 15:57:46 +02:00
Mahmoud Ben Hassine
0a75bc7d84 Deprecate Hibernate support
Resolves #4150
2022-08-24 15:49:29 +02:00
Mahmoud Ben Hassine
4d0ed63dd7 Deprecate AssertFile
Resolves #4181
2022-08-24 15:17:34 +02:00
Mahmoud Ben Hassine
7e535afb73 Refine contribution #4112
Revert the removal of `@SpringJUnitConfig`
usage in the test suite of samples.

Related to #4111
2022-08-24 10:37:02 +02:00
Glenn Renfro
8ca9802da4 Remove the JUnit dependency in AssertFile
The side effect is a breaking change in that it will now
throw IllegalStateException instead of the Compare and
AssertExceptions provided by JUnit.

Resolves #4111
2022-08-24 10:29:45 +02:00
Mahmoud Ben Hassine
c425137eec Remove datasource dependency in JobRepositoryTestUtils
Before this commit, the `JobRepositoryTestUtils` was
tied to the JDBC implementation of the `JobRepository`
as it was requiring a datasource. This makes it unusable
with implementations that do not rely on a datasource
to store batch meta-data (A MongoDB job repository for
instance where no datasource is used).

This commit decouples the `JobRepositoryTestUtils` from
the implementation details of the `JobRepository` by making
it working against the `JobRepository` interface.

This commit also introduces the necessary methods in the
`JobRepository` interface as well as various DAOs to
implement the utilities without having to deal with the
details of the underlying repository implementation.

Resolves #4070
2022-08-23 21:33:06 +02:00
Mahmoud Ben Hassine
f104baa417 Remove datasource autowiring in JobRepositoryTestUtils
Before this commit, trying to register a `JobRepositoryTestUtils` bean
in a test context that contains multiple datasources fails at startup,
because a datasource is autowired in `JobRepositoryTestUtils` while
multiple are defined.

This commit removes the autowiring of the datasource in JobRepositoryTestUtils.

Resolves #4178
2022-08-21 13:36:37 +02:00
Mahmoud Ben Hassine
fe40370f39 Refine contribution #4167
The documentation generation change introduced
in #4167 seems to scan more files than previously
WRT checking the code formatting style.

This commit fixes the formatting of the files
that do not conform to the Spring style.
2022-08-21 09:52:35 +02:00
Jay Bryant
f89aa20861 Use spring-asciidoctor-backends for documentation generation
Resolves #3865
2022-08-21 09:44:12 +02:00
Mahmoud Ben Hassine
c506a49988 Remove job autowiring in JobLauncherTestUtils
Before this commit, registering the JobLauncherTestUtils
as a bean in the test context (either manually or via
`@SpringBatchTest`) was failing when multiple jobs are
defined in the test context.

This commit removes the autowiring of the job under test
in JobLauncherTestUtils.

Resolves #1237
2022-08-20 12:39:02 +02:00
Mahmoud Ben Hassine
e67c0069f1 Use the Chunk API consistently
This commit replaces the usage of List with Chunk
where appropriate. Summary of changes:

- The Chunk class was moved from the `org.springframework.batch.core.step.item` package to the `org.springframework.batch.item` package
- The signature of the method `ItemWriter#write(List)` was changed to `ItemWriter#write(Chunk)`
- All implementations of `ItemWriter` were updated to use the Chunk API instead of List
- All methods in the `ItemWriteListener` interface were updated to use the Chunk API instead of List
- All implementations of `ItemWriteListener` were updated to use the Chunk API instead of List
- The constructor of `ChunkRequest` was changed to accept a Chunk instead of a Collection of items
- The return type of `ChunkRequest#getItems()` was changed from List to Chunk

Resolves #3954
2022-08-19 13:40:09 +02:00
Mahmoud Ben Hassine
bf2e6ab0e5 Fix StepScopeProxyTargetClassOverrideIntegrationTests
This test started failing after an upstream change in Spring Framework,
see https://github.com/spring-projects/spring-framework/issues/28115
2022-08-16 11:49:30 +02:00
Mahmoud Ben Hassine
c8f24888a7 Upgrade micrometer core to 1.10.0-M4 and tracing to 1.10.0-M7 2022-08-10 11:45:17 +02:00