【发布时间】:2018-12-16 02:14:44
【问题描述】:
如何设置任何外部数据库(mysql、postgres,我现在不关心哪个)以用于元数据?
目前我有春季批量将作业结果写入 Mongodb 并且工作正常,但我没有跟踪作业状态,因此即使中途中断,作业每次都从头开始运行。
有很多示例说明如何避免这样做,但似乎无法找到明确的答案,说明我需要配置哪些内容才能将元数据发送到真实的地方而不是内存中。
我尝试添加属性文件,但没有效果
# for Postgres:
batch.jdbc.driver=org.postgresql.Driver
batch.jdbc.url=jdbc:postgresql://localhost/postgres
batch.jdbc.user=postgres
batch.jdbc.password=mysecretpassword
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer
batch.schema.script=classpath:/org/springframework/batch/core/schema-postgresql.sql
batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-postgresql.sql
batch.jdbc.testWhileIdle=false
batch.jdbc.validationQuery=
【问题讨论】:
标签: spring spring-batch