Announcement Announcement Module
Collapse
No announcement yet.
jobLauncherTaskExecutor pool-size has no impact Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jobLauncherTaskExecutor pool-size has no impact

    I want to control the number of jobs executed in parallel. I referred http://static.springsource.org/sprin...eference.xhtml and in the context file (override folder),
    I have defined the following:
    Code:
    	<bean id="taskExecutor" parent="throttledTaskExecutor" p:throttleLimit="100"/>
    	<task:executor id="jobLauncherTaskExecutor" pool-size="2" rejection-policy="CALLER_RUNS"/>
    	<task:executor id="poolTaskExecutor" pool-size="100" rejection-policy="CALLER_RUNS"/>
    
    	<bean id="jobLauncher"
    		class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
    		<property name="jobRepository" ref="jobRepository" />
    		<property name="taskExecutor" ref="taskExecutor"/>
    	</bean>
    The jobs are started through Spring Admin with a JMS queue as the endpoint. With the above configuration, when I placed 3 messages my expectation was that only 2 will be started but I notice that all the 3 getting started. Is anything wrong with the configuration or should I use queue property of the Task Executor?
Working...
X