regarding work manager for a component of webapp in weblogic
We have a spring batch component implemented as a component of an ear application deployed on weblogic. We want to implement max thread constraint on the spring batch component and not 开发者_高级运维on the web application as a whole. So we think of implementing through work manager. Before implementing i have following doubts:
1. i can create a global work manager of maximum thread constraint in weblogic console
2. Refer it in spring batch component.
My doubt is if I implement the above approach, will it be affecting all the applications deployed on weblogic or will it affect the application only if work manager is referenced by an application.
Also I know, i can do this work manager creation through weblogic.xml of webapp, doing so may affect whole webapp as i need the max thread constraint only for a component of webapp.
Please suggest
You can control the threads available for Spring batch jobs by setting the appropriate TaskExecutor on the JobLauncher. For example:
<bean id="jobTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value ="5" />
<property name="maxPoolSize" value ="10" />
<property name="allowCoreThreadTimeOut" value="true" />
<property name="threadNamePrefix" value="batch-job-thread-" />
</bean>
<bean id="jobLauncher"
class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
<property name="taskExecutor" ref="jobTaskExecutor" />
</bean>
The above example is for Spring batch 2.1.8.
精彩评论