Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring SpringBatch with Nosql

We need to use spring batch in an application which already uses a NoSQL product (MarkLogic). I know that as a pre-requisite spring-batch uses some relational tables for infrastructure management and monitoring like batch status etc.

Does spring-batch provide a way via which we can configure it to work with NoSQL products like this?

like image 396
Prateek Avatar asked Dec 06 '25 20:12

Prateek


1 Answers

Spring Batch Job Repository is based on JDBC DAOs and support a close set of RDBM’s. For example in Spring Batch 2.2.5 its DB2, HSQL, SQLSERVER, MYSQL, ORACLE, POSTGRES,SYBASE, H2.
See org.springframework.batch.support.DatabaseType class from spring-batch-infrastructure-x.x.x.jar

As mentioned in Rafik Beldi answer Memory Based Job Repository is supported as well. Those can be a good solution if you do not care about past executions. In memory database like h2 support file based persistent that my help (although limited and unreliable from my point of view).

If you have to support NoSQL you need to develop your own or look for some existing project in github.
Basically starting by overriding JobRepositoryFactoryBean and adding your own DAOs (located under org.springframework.batch.core.repository package in spring-batch-core jar).
For more information:

  1. The Spring Batch Docs Non-standard Database Types in a Repository
  2. Some mongodb project with Spring Batch
  3. Maybe my question here will add some information

It will be nice if someone from Spring Batch team will give us some information if NoSQL support for job repository are planed to the near feature.

like image 160
Haim Raman Avatar answered Dec 08 '25 16:12

Haim Raman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!