从2.2迁移春批到4.x(XML配置分区作业

问题描述 投票:0回答:1

我迁移Spring Batch的分区乔布斯XML配置Spring Batch的4.x版我想利用在那里寻找与这两个答复信道和数据源轮询远程步骤完成MessageChannelPartitionHandler的改善。

当我使用这个配置:

<int:channel id="partitioned.jms.requests">
            <int:dispatcher task-executor="springbatch.partitioned.jms.taskExecutor"/>    
</int:channel>
<int:channel id="partitioned.jms.reply" />

    <bean id="partitioned.jms.handler" class="org.springframework.batch.integration.partition.MessageChannelPartitionHandler">
        <property name="messagingOperations">
            <bean class="org.springframework.integration.core.MessagingTemplate">
                <property name="defaultChannel" ref="partitioned.jms.requests"/>
            </bean>
        </property>
        <property name="stepName" value="process.partitioned.step"/>        
        <property name="gridSize" value="${process.step.partitioned.gridSize}"/>        
        <property name="dataSource" ref="springbatch.repositoryDataSource" />
        <property name="pollInterval" value="${springbatch.partition.verification.interval}"/>          
    </bean>

步骤完成,但我看到一个错误在日志中。

no output-channel or replyChannel header available

我看着学生们,看看我能一个replyChannel属性添加到MessageChannelPartitionHandler类。如果我添加以下内容:

<property name="replyChannel" ref="claim.acp.process.partitioned.jms.reply"/>      

我得到错误回来,一个可轮询的通道是必要的。

如何创建一个可轮询的通道(从同一个JMS队列假设)?

spring-integration spring-batch
1个回答
0
投票

你需要证明你的配置的其余部分。

如果你正在使用DB轮询的结果,设定对JMS的output-channel出站网关"nullChannel"和收到的答复过JMS将被丢弃。

或者,使用出站信道适配器(而不是网关)(以及在从站的入站信道适配器)。这避免了被完全退还的答复。

你必须设置pollRepositoryForResultstrue

为了回答您的具体问题

<int:channel id="replies>
    <int:queue />
<int:channel>
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.