Results 1 to 2 of 2

Thread: MultiResourcePartitioner on a quartz job

Hybrid View

  1. #1
    Join Date
    Jun 2010
    Posts
    6

    Default 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. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •