Announcement Announcement Module
Collapse
No announcement yet.
MultiResourcePartitioner on a quartz job Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MultiResourcePartitioner on a quartz job

    Hi!

    I'm having a problem with the combination of a MultiResourcePartitioner and a quartz job, this is my code:

    HTML Code:
        <beans:bean name="step1:master" class="org.springframework.batch.core.partition.support.PartitionStep">
            <beans:property name="jobRepository" ref="jobRepository"/>
            <beans:property name="stepExecutionSplitter" ref="cidsSimpleStepExecutionSplitter">
            </beans:property>
            <beans:property name="partitionHandler">
                <beans:bean class="org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler">
                    <beans:property name="taskExecutor" ref="syncTaskExecutor"/>
                    <beans:property name="step" ref="cidsStep1"/>
                </beans:bean>
            </beans:property>
        </beans:bean>
    
        <beans:bean id="cidsMultiResourcePartitioner"
                    class="org.springframework.batch.core.partition.support.MultiResourcePartitioner">
            <beans:property name="resources" value="file:c:/data/*.dat"/>
        </beans:bean>
    
         <beans:bean id="cidsSimpleStepExecutionSplitter" class="org.springframework.batch.core.partition.support.SimpleStepExecutionSplitter">
                    <beans:constructor-arg ref="jobRepository"/>
                    <beans:constructor-arg ref="cidsStep1"/>
                    <beans:constructor-arg ref="cidsMultiResourcePartitioner"/>
    
        </beans:bean>
    The problem that i am trying to solve is the detection of new files on the specified path. When the multiResourcePartitioner bean is created it loads the resources correctly, but if i add more files, future instances/runs of my job will only get resources that were already processed (which makes sense , since the multiResourcePartitioner resource's will not be updated).

    Do you guys know any way to solve this problem?

    Last question, is there any way to define the folder that contains files to be processed by late binding?

  • #2
    The resource list should only be the same on restart of a failed or stopped job. If you successfully complete, then the next instance will bind again.

    Late binding only happens on step scoped beans. That's all you need.

    Comment

    Working...
    X