我在Spring Integration调度程序的故障转移方面遇到了一些问题,如果我的消息处理程序失败,它应该显示异常。
我有简单的Spring集成上下文:
<int:gateway default-request-channel="inboundChannel"
service-interface="com.some.gateway.PrinterGateway"/>
<int:channel id="inboundChannel">
<int:dispatcher failover="false"/>
</int:channel>
<!--first Message Handler (broken)-->
<bean id="printService" class="com.some.service.PrinterService"/>
<int:service-activator input-channel="inboundChannel"
method="print"
ref="printService"/>
<!--second Message Handler-->
<bean id="uppercasePrintService"
class="com.some.service.UppercasePrinterService"/>
<int:service-activator input-channel="inboundChannel"
method="printUppercase"
ref="uppercasePrintService"/>
我破碎的Message Handler类:
public class PrinterService {
public void print(Message<String> message) {
throw new RuntimeException("This is error");
}
}