spring-batch-admin

JobLauncherTestUtils throws NoUniqueBeanDefinitionException while trying to test spring batch steps

﹥>﹥吖頭↗ 提交于 2021-01-27 14:51:44
问题 I am using Spring boot and Spring batch. I have defined more than one job. I am trying to build junit to test specific task within a job. Therefor I am using the JobLauncherTestUtils library. When I run my test case I always get NoUniqueBeanDefinitionException. This is my test class: @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = {BatchConfiguration.class}) public class ProcessFileJobTest { @Configuration @EnableBatchProcessing static class TestConfig {

Spring-Batch How skip exceptions works for composite writers

女生的网名这么多〃 提交于 2020-06-17 09:39:08
问题 I am using Spring Batch and my step configuration is as below: @Bean public Step testStep( JdbcCursorItemReader<TestStep> testStageDataReader, TestStepProcessor testStepProcessor, CompositeItemWriter<Writer> testWriter, PlatformTransactionManager transactionManager, JobRepository jobRepository) { return stepBuilderFactory .get("TESTING") .<>chunk(100) .reader(testStageDataReader) .processor(testStepProcessor) .writer(testWriter) .faultTolerant() .skip(DataIntegrityViolationException.class)

Quartz scheduler not working in Spring batch admin setup

和自甴很熟 提交于 2020-01-07 06:15:09
问题 Background : We've some jobs managed by spring batch ( as boot application) triggered by cron job, I'm working to replace cron with quartz and add spring batch admin to manage jobs. So far I'm able to run the jobs via spring batch admin console, issue happens when quartz attempts to fire a job execution. JobLauncher, JobLocator objects are null which is autowired. Please note I use Java based configuration not XML. @PersistJobDataAfterExecution @DisallowConcurrentExecution @Component

batch admin console - DispatcherServlet using InternalResourceViewResolver instead of FreeMarkerViewResolver

安稳与你 提交于 2020-01-03 02:43:05
问题 I have an issue with integrating the spring batch admin console into my application. The good news is that when i go to http://mymachine.com:8080/ReportingManager/batch/configuration I can get to the admin console. But when I go to http://mymachine.com:8080/ReportingManager/batch/job-configuration i get a 404 and an error saying that /batch/jobs can't be found. I've just gone through the exercise of comparing the difference in output of org.springframework.web logs between my application logs

Reading Records From a Database in Spring Batch

半世苍凉 提交于 2020-01-01 19:12:27
问题 I'm trying to read some records from a database using loops then do some calculations on the records (updating a field called total). But i'm new to spring batch so please can anyone provide me with some tips. 回答1: this sounds like something the chunk pattern would address. you can use re-use existing Spring Batch components to read from the database, compose your own processor, then pass back to a Spring Batch component to store. say the use case is like this; - read a record - record

spring batch remote chunking doesn't queue messages but runs it locally?

对着背影说爱祢 提交于 2019-12-25 12:47:43
问题 Below is my configuration for spring batch remote chunking. My steps are running locally instead of remotely. I cant see messages in rabbitmq. <beans:bean id="importExchangesChunkItemWriter" class="org.springframework.batch.integration.chunk.ChunkMessageChannelItemWriter" scope="step" p:messagingOperations-ref="importExchangesMessagingTemplate" p:replyChannel-ref="importExchangesReplyChannel"> </beans:bean> <beans:bean id="importExchangesChunkHandler" class="org.springframework.batch

spring batch remote chunking doesn't queue messages but runs it locally?

痴心易碎 提交于 2019-12-25 12:47:06
问题 Below is my configuration for spring batch remote chunking. My steps are running locally instead of remotely. I cant see messages in rabbitmq. <beans:bean id="importExchangesChunkItemWriter" class="org.springframework.batch.integration.chunk.ChunkMessageChannelItemWriter" scope="step" p:messagingOperations-ref="importExchangesMessagingTemplate" p:replyChannel-ref="importExchangesReplyChannel"> </beans:bean> <beans:bean id="importExchangesChunkHandler" class="org.springframework.batch

spring batch admin ui not showing jobs that are be configured

一世执手 提交于 2019-12-25 08:28:57
问题 I have integrated spring boot with spring-batch-admin successfully. I used the sample guide from spring-batch for setting up jobs. I added couple of more tasklets to the jobs. my UI shows only one job. I expect to see three of them. I also the expect the three jobs to have start/stop functionalities and take job parameters from UI. I have pushed entire code here.. please feel free to issue pull requests if you have solutions or improvements. Here is my job.xml located in src/main/resources

java.lang.ClassCastException: java.lang.String cannot be cast to com.common.batch.model.Customer - Spring Batch CompositeItemReader and Writter

倖福魔咒の 提交于 2019-12-25 06:24:00
问题 I am developing Spring Batch CompositeItemReader and Writter example. In this program I am trying to read data two tables from mysql db table and write to single XML file . When trying to do that I see following error is coming: java.lang.ClassCastException: java.lang.String cannot be cast to com.common.batch.model.Customer at com.common.batch.processor.CustomerProcessor.process(CustomerProcessor.java:1) at org.springframework.batch.core.step.item.SimpleChunkProcessor.doProcess

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="$