spring-batch

Spring batch admin remote partition steps running maximum 8 threads even though concurrency is 10?

可紊 提交于 2019-12-25 03:58:08
问题 I am using spring batch remote partitioning for batch process. I am launching jobs using spring batch admin. I have inbound gateway consumer concurrency step to 10 but maximum number of partitions running in parallel are 8. I want to increase the consumer concurrency to 15 later on. Below is my configuration, <task:executor id="taskExecutor" pool-size="50" /> <rabbit:template id="computeAmqpTemplate" connection-factory="rabbitConnectionFactory" routing-key="computeQueue" reply-timeout="$

What does Failed to convert property value of type '$Proxy0 to required type means in this case?

让人想犯罪 __ 提交于 2019-12-25 03:28:20
问题 i'm facing this error message: Error creating bean with name 'jdbcWriter', Initialization of bean failed, Failed to convert property value of type '$Proxy0 to required type for property 'itemPreparedStatementSetter'. This is my code: <beans:bean id="jdbcWriter" class="org.springframework.batch.item.database.JdbcBatchItemWriter"> <beans:property name="dataSource" ref="dataSource"/> <beans:property name="sql" value="update Trans_Tst set (amount) values (?) where id= ?"/> <beans:property name=

IntegrationFlows with FileReadingMessageSource triggering job twice for same input file

笑着哭i 提交于 2019-12-25 03:26:21
问题 I have a Spring Integration Batch job which is triggerred when the files are arrived: @Bean public IntegrationFlow fileTriggeredIntegrationFlow() { return IntegrationFlows.from(fileReadingMessageSource(), c -> c.poller(Pollers.fixedRate(filePollerFrequency, filePollerInitialDelay))) .transform(toJobLaunchRequest()) .handle(jobLaunchingGateway) .handle("jobCompletionHandler", "afterJob") .get(); } @Bean public FileReadingMessageSource fileReadingMessageSource() { FileReadingMessageSource

SpringBatch local partitioning restart problems

霸气de小男生 提交于 2019-12-25 03:22:45
问题 I am having issues with restart of local partitioning batch. I am throwing RuntimeException on 101st processed item. The job fails, but something is going wrong, because on restart, the job continues from 150th item (and not from the 100th item that it should). Here is the xml-conf : <bean id="taskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor" > <property name="workManagerName" value="springWorkManagers" /> </bean> <bean id="transactionManager" class="org

Spring Batch Xml Item Read

北城余情 提交于 2019-12-25 02:28:56
问题 I'm working with Spring Batch. I think I already know how I can parse good-looking xml and binding object. And I stuck with this problem. <parent> <child> <key name="xxx"> <value>val</value> </key> <key name="yyy"> <value>val</value> </key> </child> </parent> How can I parse xml items for above xml to children defined like this? class Child { private String xxx; private String yyy; } I know how I can parse when it looks like this. <parent> <child> <xxx>val</xxx> <yyy>val</yyy> </child> <

Dynamic Job Scheduling with Quartz or any other java api

荒凉一梦 提交于 2019-12-25 02:18:42
问题 I have an UI Interface where user can define Job name, interval, active/Inactive etc. How we can achieve this with Quartz Scheduler or any java/Spring api ? Ex. Suppose any Quartz job is started and interval is set as 10 min, So in ideal case job will run in next 10 min interval. But every time job runs we want to fetch the latest interval from database and schedule it. 10:00 Job runs and in the database interval is set to 10 min 10:10 Job runs and in the database interval is set to 20 min So

CannotCreateTransactionException: com.microsoft.sqlserver.jdbc.SQLServerException Login Error

给你一囗甜甜゛ 提交于 2019-12-25 01:56:23
问题 i am using Spring Batch with a Microsoft SQL 2014 Database. It is running on a Tomcat 9.0.16 Server with OpenJDK 11.0.2 My Problem is that i get randomly errors in which there is no JDBC Connection possible. There are two Steps defined in the Job: The first one contains the following Tasklet The relevant Code : @Bean public Step stepOne() { final Tasklet taskletOne = new Tasklet() { @Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws

How to enable transaction management in spring application running on multiple JVMs

混江龙づ霸主 提交于 2019-12-25 00:58:28
问题 I have started using Spring framework from last few months. I have a question on how the transaction manager works in the below scenario. Scenario : I'm working on a spring batch in which the ItemReader calls the below method multiple times. This method fetches the list of records from the 'STUDENTS' table which are in status 'NOT COMPLETED' and updates the status of these records to 'IN PROGRESS'. I'm processing 10 million records hence I'm planning to execute my batch process using multiple

How can I update all records from a source db table to a target db table using spring batch?

让人想犯罪 __ 提交于 2019-12-25 00:54:50
问题 I have a spring batch program that pulls data from a source DB to a target DB once a day. In the case that a record is updated on the source DB side. How can I detect that and update my target DB? 来源: https://stackoverflow.com/questions/55869015/how-can-i-update-all-records-from-a-source-db-table-to-a-target-db-table-using-s

Resource name not reflecting on second file correctly

主宰稳场 提交于 2019-12-25 00:46:40
问题 I have a spring batch application where my Model is ResourceAware . I am reading multiple files in my application: @Data @Slf4j public class Model implements ResourceAware { private String countryCode; private Resource resource; public Resource getResource() { return resource; } @Override public void setResource(Resource resource) { this.resource = resource; } } @Configuration public class BatchConfiguration { @Autowired private JobBuilderFactory jobBuilderFactory; @Autowired private