튜토리얼 스프링 배치 프로젝트를 성공적으로 설정했습니다. "스프링 레벨"에서 멀티 스레드 화가 가능한지 알고 싶습니다.스프링 배치에서 멀티 스레딩을 설정하는 방법은 무엇입니까?
기본 아이디어는 작업 또는 작업 단계 목록을 만들어 독립적 스레드, 이상적으로는 'n'개의 스레드로 제한된 독립적 인 스레드에 의해 선택 및 작업되도록하는 것입니다.
이것이 가능합니까? 그렇다면 어떻게? 누군가 내가 현재 어디에서 왔는지 그 지점을 안내 해줄 수 있습니까?
내가 가지고있는 간단한 프로젝트는이 튜토리얼 here입니다. 기본적으로 화면에 메시지를 출력하는 다른 작업이 있습니다.
<import resource="applicationContext.xml"/>
<bean id="hello" class="helloworld.PrintTasklet">
<property name="message" value="Hello"/>
</bean>
<bean id="space" class="helloworld.PrintTasklet">
<property name="message" value=" "/>
</bean>
<bean id="world" class="helloworld.PrintTasklet">
<property name="message" value="World!\n"/>
</bean>
<bean id="taskletStep" class="org.springframework.batch.core.step.tasklet.TaskletStep" >
<property name="jobRepository" ref="jobRepository"/>
<property name="transactionManager" ref="transactionManager"/>
</bean>
<bean id="simpleJob" class="org.springframework.batch.core.job.SimpleJob">
<property name="name" value="simpleJob" />
<property name="steps">
<list>
<bean parent="taskletStep">
<property name="tasklet" ref="hello"/>
</bean>
<bean parent="taskletStep">
<property name="tasklet" ref="space"/>
</bean>
<bean parent="taskletStep">
<property name="tasklet" ref="world"/>
</bean>
</list>
</property>
<property name="jobRepository" ref="jobRepository"/>
</bean>
내 appContext이 작업 저장소 콩 (SimpleJobRepository
), 트랜잭션 관리 (ResourceLessTransactionManager
) 및 작업 실행 (SimpleJobLauncher
)를 포함
다음은 작업의 세부 사항을 포함 내 현재 simpleJob.xml 파일입니다. 원하는 경우이 코드를 제공 할 수 있습니다. XML을 사용하여이 게시물을 꼼짝 못하게하고 싶었습니다.
도움을 주셔서 대단히 감사합니다!