【问题标题】:Spring XD - Issue with Auto Acknowledgment for Exception in ProcessorSpring XD - 处理器中异常的自动确认问题
【发布时间】:2015-11-25 16:04:50
【问题描述】:

我有 Spring XD 流,其中包含各种模块,并且为流启用了 DLQ,我无法根据流中的 http 客户端重试场景的需要删除这些流。在一个处理器中,我抛出异常并且不想在这种情况下将输出传递给流中的下一个处理器/模块,我可以使用 Filter as 来实现这一点

<filter throw-exception-on-rejection="true"  ref="batchDataFilter" method="transform"/>

在此我能够实现,因为异常没有传递到流中的下一个模块,但由于配置了 DLQ,异常正在重试,我想在异常/错误中确认此消息,因此它不应该重试,我能够记录此消息。

下面是我的Spring文件配置

<chain input-channel="input" output-channel="output" >

<int:transformer>
  <beans:bean class="com.capitalone.batch.parser.BatchInputParser" >
    <beans:property name="batchInputProperties" ref="inputfields"/>
  </beans:bean>

</int:transformer>

             <filter throw-exception-on-rejection="true"  ref="batchDataFilter" method="transform"/>


</chain>

谢谢..

【问题讨论】:

    标签: spring spring-integration spring-xd


    【解决方案1】:

    要禁用特定流模块的重试并始终拒绝 DLQ,请使用部署属性。

    deploy stream myStream --properties module.foo.consumer.maxAttempts=1,module.foo.consumer.requeue=false
    

    您可以在servers.yml 中的总线级别设置相同的选项。

    【讨论】:

    • 感谢它对我有用,但消息仍然停留在 DLQ 中它没有重试但消息仍然存在于 DLQ 中,我为我的模块添加了属性为“module.HeaderReader.consumer.autoBindDLQ=false”和它没有发布到 DLQ..谢谢
    猜你喜欢
    • 1970-01-01
    • 2015-12-08
    • 2012-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-27
    相关资源
    最近更新 更多