【发布时间】:2018-03-09 05:47:07
【问题描述】:
在之前的 Spring 集成应用程序中,我能够订阅 应用程序 errorChannel,而我的失败消息(向外发送)最终会出现在我的(预定义)处理程序中。
但是,现在我正尝试在更大的应用程序中实现相同的模式,该应用程序具有预先存在的入站设置,并且我不再能够在 errorChannel 上被选中.
对我来说最令人担忧的是:
<int:publish-subscribe-channel id="errorChannel" task-executor="errorChannelExecutor"/>
当我启动这个应用程序时,我不再看到以下令人放心的消息:
No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
Adding {logging-channel-adapter:o.s.i.errorLogger} as a subscriber to the 'errorChannel' channel
Channel'o.s.c.s.C.errorChannel' has 2 subscriber(s).
- 你认为
int:publish-subscribe-channel是压倒一切 我对应用程序 errorChannel 的访问权限? - 为什么不再引用日志中的默认errorChannel?
- 有没有一种方法可以定义一个alternate 错误通道,只关注出站连接?
【问题讨论】:
-
是的,它使用 pub-sub 频道覆盖了默认的
errorChannel。重命名pub-sub,你应该很好。想试试吗? -
问题是
errorChannel已经定义了,所以我不能简单地在 spring 集成中重命名它。除非有办法为错误通道使用不同的名称,特别是在应用程序的出站部分? -
我的意思是重命名您的 pub-sub 频道(您问题中的频道是您定义的频道,对吗?) - 不是重命名默认的 errorChannel。
-
感谢您的回复 - pub-sub 频道是预先存在的入站代码。我通常会订阅我的出站部分的默认频道。还有其他想法吗?
标签: java spring apache-kafka spring-integration