Initial situation
We are currently facing the challenge of migrating our applications to Spring Boot 3.x across the entire enterprise. Due to the intensive use of Spring Data Neo4j (SDN), a migration to SDN 7.2.1 must be carried out implicitly beforehand, in which the Object Graph Mapper (OGM) is omitted in favor of a renewed Spring Data Neo4j. See https://docs.spring.io/spring-data/neo4j/reference/appendix/migrating.html
Problem
The equally intensively used Spring Batch Framework (spring-boot-starter-batch, 2.7.18) still requires a SessionFactory of the Neo4j Object Graph Mapper for the Neo4jItemReader and Neo4jItemWriter, which, however, no longer exists as intended.
A manually created CustomNeo4jItemReader and CustomNeo4jItemWriter, in which the previous OGM session (org.neo4j.ogm.session.Session) is replaced by direct access to the Neo4j driver, does not work either, as this new driver session (org.neo4j.driver.Session) lacks many of the methods used by Spring Batch.
Target situation
How can we use Spring Batch and Neo4j with Spring Data Neo4j 7.2.1 and higher and thus follow the Spring Release Train?
Versions
- Spring Boot from version 2.7.18
- Spring Data Neo4j (SDN) from version 7.2.1
- Spring Batch 2.7.18 (bundled version of Spring Boot)
- Spring Batch Extensions