spring-batch

Spring Cloud DataFlow and MySQL doesn't show the START_TIME and END_TIME of the Task

↘锁芯ラ 提交于 2020-05-08 05:53:12
问题 I'm working on Spring batch and SCDF example. In this example I am reading CSV file and loading all the data to MySQL . I was able to successfully load the data into MySQL DB, but but UI doesn't show me START_TIME and END_TIME , even db doesn't holds any records. I've uploaded my code here: https://github.com/JavaNeed/spring-cloud-dataflow-example1.git spring-cloud-data-flow-server SpringCloudDataFlowServerApplication.java @EnableDataFlowServer @SpringBootApplication(exclude = {

Spring Cloud DataFlow and MySQL doesn't show the START_TIME and END_TIME of the Task

南笙酒味 提交于 2020-05-08 05:53:12
问题 I'm working on Spring batch and SCDF example. In this example I am reading CSV file and loading all the data to MySQL . I was able to successfully load the data into MySQL DB, but but UI doesn't show me START_TIME and END_TIME , even db doesn't holds any records. I've uploaded my code here: https://github.com/JavaNeed/spring-cloud-dataflow-example1.git spring-cloud-data-flow-server SpringCloudDataFlowServerApplication.java @EnableDataFlowServer @SpringBootApplication(exclude = {

Spring Batch - write to 2 tables at once

蹲街弑〆低调 提交于 2020-04-30 09:19:28
问题 I have a Person object that has a list of addresses. My Spring Batch app converts Person JSON recors into Person POJOs and writes them to a database. Ordinarily, I'd use JdbcBatchItemWriter but I see it is limited in writing to 2 seperate tables. I need to write to Person and Address table. Hibernate could write this in one step but I don't see a simialr capability in Spring Bathc. This SO question Multiple itemwriters in Spring batch suggests using a CompositeItemWriter but the issue with

What is the best way to flatten a list of lists in Spring Batch?

Deadly 提交于 2020-04-30 07:26:41
问题 In Spring Batch, processors Map from one of an Input type to one of an Output type. However I have a need to generate a list of Output type ( List<O> ) from one I . The processor can return the List<O> just fine, but supposing I want to work with the elements of this list as individuals in subsequent processors. Am I expected to write them to the database first? In fact I have some enrichment from a remote service that needs to be done to each member of the List<O> so I do not want them

What is the best way to flatten a list of lists in Spring Batch?

半城伤御伤魂 提交于 2020-04-30 07:26:07
问题 In Spring Batch, processors Map from one of an Input type to one of an Output type. However I have a need to generate a list of Output type ( List<O> ) from one I . The processor can return the List<O> just fine, but supposing I want to work with the elements of this list as individuals in subsequent processors. Am I expected to write them to the database first? In fact I have some enrichment from a remote service that needs to be done to each member of the List<O> so I do not want them

Is there anyway to avoid processing same file twice with Spring Batch?

老子叫甜甜 提交于 2020-04-30 06:27:22
问题 I am working on the 3 steps Spring Batch project. Firstly, it downloads needed text files from ftp to local, then process it, and finally delete files in the local directory every 10 minutes. And every 10 minutes there are new files loaded in the FTP. What if there emerge some problem in the FTP and it does not load new files? Then Spring Batch project download same file and process it again. So my question is that how can avoid Spring Batch to process same file twice? Edit: I have used

Is there anyway to avoid processing same file twice with Spring Batch?

只谈情不闲聊 提交于 2020-04-30 06:26:55
问题 I am working on the 3 steps Spring Batch project. Firstly, it downloads needed text files from ftp to local, then process it, and finally delete files in the local directory every 10 minutes. And every 10 minutes there are new files loaded in the FTP. What if there emerge some problem in the FTP and it does not load new files? Then Spring Batch project download same file and process it again. So my question is that how can avoid Spring Batch to process same file twice? Edit: I have used

Spring Batch - Unable to save the records into Postgres database

别来无恙 提交于 2020-04-30 06:23:06
问题 I am using the same code: na] Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist - Spring Batch and unable to save the records into DB. I already have the table created CREATE TABLE "BATCH".employee ( rowid_object int4 NOT NULL, status varchar NULL ) WITH ( OIDS=FALSE ) ; -- Permissions ALTER TABLE "BATCH".employee OWNER TO postgres; LifeCycleStatusWriter.java @Component public class EmployeeWriter implements ItemWriter<Employee> { @Autowired @Qualifier(value

Spring Batch - Unable to create metadata tables on Postgres and load actual data to mysql

徘徊边缘 提交于 2020-04-28 08:19:54
问题 I am developing Spring Boot v2.2.6.RELEASE + Spring Batch . In this example, I am looking to read csv file, load the data into mysql and spring batch metadata tables into the Postgres database. But This gives me error: java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:787) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.callRunners(SpringApplication

Spring Batch - Unable to create metadata tables on Postgres and load actual data to mysql

≡放荡痞女 提交于 2020-04-28 08:18:28
问题 I am developing Spring Boot v2.2.6.RELEASE + Spring Batch . In this example, I am looking to read csv file, load the data into mysql and spring batch metadata tables into the Postgres database. But This gives me error: java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:787) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.callRunners(SpringApplication