实际上
<tcp-connection-event-inbound-channel-adapter>发送给
channel一个
Message与
TcpConnectionExceptionEvent(在你的情况下)的
payload。
因此,您的订阅者(您的
TcpErrorHandler)可以接受
TcpConnectionExceptionEvent作为方法参数。
在该方法中,您可以进行进一步的逻辑处理,例如从中提取原始
Exception内容
IntegrationEvent。
使用
IP时模块中有多个位置
TcpConnectionSupport.publishConnectionExceptionEvent。
如果您说不了解
time outexception,那么如果您共享此事的日志,那就太好了。我不知道我们做哪个地方不
try...catch上
SocketTimeoutException…
更新
<int-ip:tcp-connection-event-inbound-channel-adapter channel="events" event-types="org.springframework.integration.ip.tcp.connection.TcpConnectionExceptionEvent"/><service-activator input-channel="events" ref="tcpErrorHandler"/>
public class TcpErrorHandler { public void onException(TcpConnectionExceptionEvent event) { System.out.println("Exception!!! "); event.getCause(); .... }}这应该工作。
更新2
根据您的代码:
try { super.send(message);}catch (Exception e) { System.out.println("catched_send_exception");}您是否认为在其中窒息异常是不好的?
从另一面看:确定要调用您的日志时,您介意
DEBUG为该
org.springframework.integration类别打开日志记录级别并在此处共享日志
tcpErrorHandler吗?
从另一侧尝试
<int-ip:tcp-connection-event-inbound-channel-adapter>完全没有
event-types。我的意思是让我们看看它是否可以处理任何内容
IpIntegrationEvent。



