spring-batch

Creating a 'decider-step-loop' with spring-java-config

做~自己de王妃 提交于 2019-12-24 02:21:07
问题 I'm trying to port a spring-batch job, which is defined in xml to a java-config based job. This is a snippet of my job-configuration-file: <decision id="decision" decider="someDecider"> <next on="continue" to="stepCont" /> <next on="timeout" to="stepTimeout" /> <end on="COMPLETED" /> </decision> <step id="stepCont" next="stepReport"> ... do something </step> <step id="stepReport" next="decision"> ... create report </step> <step id="stepTimeout"> ... </step> Is there a way to create such a

Migrating Spring Batch MyISAM Sequence Tables to InnoDB

允我心安 提交于 2019-12-24 02:19:07
问题 Spring batch uses a few sequence tables, which in the case of MySQL use the MyISAM storage engine. The issue I'm facing is that I'm using an Amazon Web Services RDS database, and their "Point in Time" database restore feature does not play nicely with databases containing MyISAM tables. I'm looking for a solution that will let me switch out these Spring Batch MyISAM sequence tables and replacing them with InnoDB tables instead, with the goal of enabling the AWS RDS "Point in Time" database

Combine rows from 2 files and write to DB using Spring Batch

戏子无情 提交于 2019-12-24 01:16:16
问题 I have File1.csv, with the columns id,name,age. File2.csv has the columns id,designation. In both the files ID refers to same value and is unique. Sample data File1.csv id name age 101 abc 30 102 def 25 File2.csv id designation 101 manager 102 Assistant manager Spring batch should read the files simultaneously, combine the data and write to DB as below id name age designation 101 abc 30 manager 102 def 25 Assistant manager How to read 2 files simultaneously in spring batch? 回答1: You have to

skip FlatFileParseException or specific exception in Spring Batch

社会主义新天地 提交于 2019-12-24 00:44:34
问题 Hi I have requirement to read (n number) of flat file. During file reading if received FileParseException: from reader then stop the current file reading and came out safely and process next file and continue the job execution. currently i have this xml config but i don't want to go with this because i don't have a really skip limit count. is there any way to handle this scenario may be using ItemReaderListener ? <chunk reader="flatFileItemReader" writer="itemWriter" commit-interval="10" skip

Spring batch : dynamic chunk size

佐手、 提交于 2019-12-23 23:02:38
问题 I have step reads multiple resources, I need to change chunk size depending on number of lines of each file. is it possible with spring batch to have dynamic chunk size, or there is any other way to do it? 回答1: You could do Spring Batch Step Partitioning . Partitioning a step so that the step has several threads that are each processing a chunk of data in parallel. This is beneficial if you have a large chunk of data that can be logically split up into smaller chunks that can be processed in

dynamically replace the value to placeholder in config xml file in Spring Batch

末鹿安然 提交于 2019-12-23 21:41:23
问题 I am using Spring Batch 2 version. I am reading data from database using JdbcCursorItemReader .I have successfully fetched the data and also written it to a file. Below is itemReader bean defined in Job.xml File:: <bean id="itemReader" class="org.springframework.batch.item.database.JdbcCursorItemReader" scope="step"> <property name="dataSource" ref="dataSource" /> <property name="sql" value="select u.ID, u.USER_LOGIN, u.PASSWORD, u.AGE from USERS u" /> </property> <property name="rowMapper">

Error Integrating Spring batch with spring-batch-admin-manager on Spring-boot

筅森魡賤 提交于 2019-12-23 20:46:31
问题 I am trying to integrate spring-batch-admin-manager with spring-boot-starter-batch together using spring-boot embedded tomcat configuration. However I am have this error trace which I cant nail down: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.batch.core

Spring Batch CommandLineJobRunner can't find .xml configuration file

偶尔善良 提交于 2019-12-23 19:53:33
问题 I'm a total beginner in Spring Batch Framework, and I found easily understandable codes from http://www.javabeat.net/introduction-to-spring-batch/ to use as a learning tools. I have my project set up in Eclipse similiar to the codes from the page, it looks like this : and the code executes the jobs in fileWritingJob.xml using CommandLineJobRunner like so : package net.javabeat.articles.spring.batch.examples.filewriter; import org.springframework.batch.core.launch.support.CommandLineJobRunner;

How to write from one database to another using SPRING-Batch w/out translating the resultset into a list of temporary objects or a map?

落爺英雄遲暮 提交于 2019-12-23 19:13:20
问题 Steps: Read "Select x, y, z from TABLE_1" from Database1 into a ResultSet. pass ResultSet to a Writer Write all records returned by the ResultSet to TABLE_2 in Database2. Requirement: Do not create any unused Objects to hold the data after reading from the ResultSet. (i.e. no Table1.class) Use as much pre-built functionality as possible from the SPRING-Batch framework. No DB Link. NOTE: Class names for me to reference are enough to get me on the right path. 回答1: assuming you use

Integration issues with Spring Batch and Spring Integration - “No poller has been defined for endpoint” exception

拟墨画扇 提交于 2019-12-23 18:20:32
问题 I went through the Spring Integration guide and the examples here and got a working sample for Spring Integration SFTP program. I already have a working Spring Batch program that reads a bunch of file and dumps into the Database. I am now trying to integrate both Spring Batch and Spring Integration programs by going through the Spring docs and I created the below configuration. <bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">