Spring Batch with memory DB -我有使用H2 memory DB的Spring Batch process (出于性能目的)。
到目前为止,它是一个多步骤和多线程的进程,工作得很好,但其中一个要求是使其在失败时可重启(和可恢复)。
现在,该进程被设计为在完成(或崩溃)时终止Spring Boot应用。
我的问题是,如何才能在不更改DB for file的情况下添加重新启动功能,也不会在总体上影响性能?
其中一个想法是添加另一个在将数据库转储到文件失败时执行的步骤,但接下来会发生什么呢?如何做好恢复的过程?
我已经创建了自定义ItemReader:
@Component("pricereader")
public class MyItemReader implements ItemReader<Price>{
@Override
public Price read() throws Exception, UnexpectedInputException, ParseException,
NonTransientResourceException {
// TODO Auto-generated method stub
return nu
我正在开发Spring和Apache 。灵感来源:。在本例中,我只是试图读取客户流,希望将这些数据写入CSV。
错误:
org.apache.kafka.common.errors.SerializationException: Error deserializing key/value for partition customers-0 at offset 0. If needed, please seek past the record to continue consumption.
Caused by: org.apache.kafka.common.errors.Serializat
我希望在服务器上创建Spring批处理元数据,并使用来自MySQL的所有现有表从MySQL中获取数据并将其放入MongoDB。
我创建了以下配置,但不知怎么缺少了通过配置创建Spring批处理元数据表的诀窍。
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.database=MY_DB
#By default, Spring runs all the job as soon as it has started its context.
spring.batch.job.
我有一个问题,我想从一个表中删除所有条目,然后用与从头开始删除的ID相同的ID重新创建单个条目。这应该在一个事务中进行,这样表就不会是空的。
提示:我使用Spring并通过块侦听器beforeChunk (在事务内部)删除talbe,读取器/编写器随后运行,以持久化数据的新版本。
现在,如果我这样做,我就会收到这样的错误:
Encountered an error executing step importXXXXX in job jobXXXX java.lang.IllegalArgumentException: Cannot merge an Entity that has been r
我一直在尝试创建一个Spring批处理程序,它必须从数据库读取某些数据并将其写入另一个表中。我不希望在我的数据库中创建Spring批处理元数据表。当我尝试的时候,我无法完成交易。
我通过扩展DefaultBatchConfigurer并像这样覆盖元数据表,避免了元数据表,
@Override
public void setDataSource(DataSource dataSource) {
// override to do not set datasource even if a datasource exist.
// initialize wil
基本的Spring数据JPA应用程序(不是Spring引导应用程序)。有没有人知道是什么原因导致了这个问题:错误:
at org.springframework.beans.factory.annotation.
InitDestroyAnnotationBeanPostProcessor$LifecycleElement
.invoke(InitDestroyAnnotationBeanPostProcessor.java:344)
at org.springframework.beans.factory
.annotation.InitDestroyAnnotationBeanPostPr