spring-batch

Spring Batch database Connection is not available, request timed out

感情迁移 提交于 2019-12-02 15:59:07
问题 During the work with Spring Batch for a project, I ran into the following problem. The project consists of: a MySQL database (mysqld 10.2.13-MariaDB) Spring Boot (2.1.1.RELEASE) Spring Batch (4.1.0.RELEASE) Spring Batch is configured to use the same datasource as the business logic for the JobRepository The hikari connection pool size for the datasource is configured to have a size of 4 (which is the default when pusing the app to our CloudFoundry instance and injected during the auto

Using Spring Batch with auto-configure and a non-standard database

我与影子孤独终老i 提交于 2019-12-02 15:03:16
问题 I am attempting to create a Spring Batch application. We use a SQL Anywhere database, which is effectively SQLSERVER , a known database type. To make things easier I am using @SpringBootApplication on my main class and @EnableBatchProcessing on my configuration class. The problem is that my database driver, sybase.jdbc4.sqlanywhere.IDriver , returns a product name "SQL Anywhere" and this is not recognized by Spring, causing various errors. I was able to get past some of them by explicitly

How can I get started with Spring Batch? [closed]

↘锁芯ラ 提交于 2019-12-02 14:01:06
I'm trying to learn Spring Batch , but the startup guide is very confusing. Comments like You can get a pretty good idea about how to set up a job by examining the unit tests in the org.springframework.batch.sample package (in src/main/java) and the configuration in src/main/resources/jobs. aren't exactly helpful. Also I find the Sample project very complicated (17 non-empty Namespaces with 109 classes)! Is there a simpler place to get started with Spring Batch? Pascal Thivent A few pointers: Spring Batch HelloWorld Spring Batch "Hello World" 1 Spring Batch "Hello World" 2 A first look at

Multiple spring batch jobs

这一生的挚爱 提交于 2019-12-02 13:28:39
问题 I am using the @Scheduled annotation in Spring Boot to trigger multiple jobs. Following is the code snippet: @EnableBatchProcessing @EnableScheduling public class Config extends DefaultBatchConfigurer{ @Autowired JobLauncher launcher; @Scheduled public void run(){ String[] argList = {"A", "B"}; for(String char : argList){ launcher.run(job(), new JobParametersBuilder(). addString("char", char). toJobParameters()); } } public Job job(){ //Job definition is here. } } However, this triggers the 2

Reader(StaxEventItemReader) Resource to Domain object

浪子不回头ぞ 提交于 2019-12-02 13:23:33
问题 I want to pass the input resource location as a String to a field of the domain object. My configuration looks like this: <bean id="step2Reader" class="org.springframework.batch.item.file.MultiResourceItemReader"> <property name="resources" value="file:${step2.reader.resource}/*/*/*.xml"></property> <property name="delegate" ref="mainReader"></property> </bean> <bean id="mainReader" class="org.springframework.batch.item.xml.StaxEventItemReader" scope="step"> <property name=

Spring Batch database Connection is not available, request timed out

馋奶兔 提交于 2019-12-02 12:47:33
During the work with Spring Batch for a project, I ran into the following problem. The project consists of: a MySQL database (mysqld 10.2.13-MariaDB) Spring Boot (2.1.1.RELEASE) Spring Batch (4.1.0.RELEASE) Spring Batch is configured to use the same datasource as the business logic for the JobRepository The hikari connection pool size for the datasource is configured to have a size of 4 (which is the default when pusing the app to our CloudFoundry instance and injected during the auto-reconfiguration of Spring) As a reference you can take a look into the sample project where I created a

Spring Batch : Field or property 'stepExecutionContext' cannot be found

那年仲夏 提交于 2019-12-02 11:51:58
I have the following spring batch job configuration. There is a single reader which then passes details to a composite writer which has two specific writers. Both writers share a common parent and need to use the same JobId for the INSERT operations they execute. <bean id="job" parent="simpleJob"> <property name="steps"> <list> <bean parent="simpleStep"> <property name="itemReader" ref="policyReader"/> <property name="itemWriter" ref="stagingCompositeWriter"/> </bean> </list> </property> </bean> <bean id="stagingCompositeWriter" class="org.springframework.batch.item.support.CompositeItemWriter

Error while deploying Spring Batch in Weblogic BeanCreationException: Error creating bean with name 'jobRepository'

我怕爱的太早我们不能终老 提交于 2019-12-02 10:36:57
I want to test Spring Batch, but I need to use it without maven or gradle because there are some restrictions in the network. I read a tutorial on spring and the spring documentation to configure a Job , but I get an "Error creating bean with name 'jobRepository'" This question has been asked already without an answer. I'm using Jeveloper and Weblogic 12.1.3.0.0. My project has the following dependencies which I get from another project configured with Eclipse Maven: com.ibm.jbatch-tck-spi-1.0.jar commons-logging-1.2.jar hsqldb-2.3.3.jar javax.batch-api-1.0.jar jcl-over-slf4j-1.7.12.jar

Spring Batch : PassThroughFieldExtractor with BigDecimal formatting

十年热恋 提交于 2019-12-02 10:17:23
I'm using Spring Batch to extract a CSV file from a DB table which has a mix of column types. The sample table SQL schema is [product] [varchar](16) NOT NULL, [version] [varchar](16) NOT NULL, [life_1_dob] [date] NOT NULL, [first_itm_ratio] [decimal](9,6) NOT NULL, the sample Database column value for the 'first_itm_ration' field are first_itm_ratio 1.050750 0.920000 but I would like my CSV to drop the trailing zero's from values. first_itm_ratio 1.05075 0.92 I'd prefer not to have to define the formatting for each specific field in the table, but rather have a global object specific

Spring Batch Meta-Data tables Purging

感情迁移 提交于 2019-12-02 09:47:17
In MySQL DB, 1. Does spring batch provides a way to purge meta-data tables? 2. Or we need to purge and archive the meta-data tables manually? 3. how spring meta-data tables are maintained well in PROD environment with out Purging mechanism? Need guidance on this! i have been struggling with this for a ling time but, there is no standard implementation for this. Then i came up with a my own stored procedure , I have created my own variable - for clearing last 6 months data AGO_SIX_MONTH_DATE You can use your own value. CREATE OR REPLACE PROCEDURE SPRINGBATCH."SPRINGBATCH_METADATA_CLEANUP" IS