$ the-wire · showcase
Spring Batch deprecates setters for required dependencies
By RepoJournal · Filed · About Spring · Composed from the cited sources · methodology
Spring Batch's v6.0 API redesign reaches into constructors, deprecating setter injection for mandatory collaborators and narrowing several redundant APIs ahead of removal, while the Mongo job repository loosens its transaction-manager coupling.
Deprecate setters for constructor-injected required dependencies spring-projects/spring-batch
Setters for constructor-injected required dependencies on item readers and writers are now deprecated, continuing the v6.0 push toward fail-fast construction and immutability; setResource is deliberately left alone on item streams implementing ResourceAware, since it is the sole contract method available there. Code that configures mandatory collaborators through setters should move to construc...
Deprecate `JobInstance::getInstanceId` for removal to eliminate redundancy spring-projects/spring-batch
JobInstance::getInstanceId is deprecated for removal, with the redundancy it duplicates left as the replacement path. Any code that reads a JobInstance's id through that method needs to migrate.
Allow to use Mongo JobRepository with any PlatformTransactionManager spring-projects/spring-batch
Mongo JobRepository no longer requires a MongoTransactionManager, aligning it with the JDBC implementation so ResourcelessTransactionManager and other custom PlatformTransactionManager implementations work.
Remove redundant methods which are identical to default method spring-projects/spring-batch
Methods identical to their interface default counterparts were removed outright, a source-level break for anything that overrode or invoked them.
Add caching for native build tools spring-projects/spring-aot-smoke-tests
Elsewhere, the AOT smoke tests now cache native build tools, trimming repeated work in the native build path.
Action items
- → Migrate setter-configured required dependencies on Spring Batch item readers and writers to constructor injection spring-projects/spring-batch [plan]
- → Replace JobInstance::getInstanceId calls before the method is removed spring-projects/spring-batch [plan]