0
votes

I created a small Tcp communication application linked below.

si_tcp_sample

It is based on TCP Sample in spring-integration-samples. The message generated by the Gateway is sent over TCP by the Outbound Gateway to the Inbound Channel Adapter. In turn the Outbound Channel Adapter echo response comes back over TCP. This application has two TcpNetClientConnectionFactories, the one is set a interceptor factory chain and another is not. Running this application, the log like below is outputted.

TcpConnectionOpenEvent with TcpConnection wrapped Interceptor↓
16:50:01.411 [main] DEBUG com.neriudon.example.tcp.listener.TcpConnectionEventsListener - ★OPEN★ TcpConnectionOpenEvent [source=SimpleInterceptor:null], [factory=unknown, connectionId=localhost:50001:64609:627f6eb5-401f-44e2-88a9-4f966ee66092] **OPENED** 

TcpConnectionOpenEvent with raw TcpConnection↓
16:50:01.426 [main] DEBUG com.neriudon.example.tcp.listener.TcpConnectionEventsListener - ★OPEN★ TcpConnectionOpenEvent [source=TcpNetConnection:localhost:50002:64610:ee9b0bcd-aa9a-4fdb-9194-2e761caabed6], [factory=client2, connectionId=localhost:50002:64610:ee9b0bcd-aa9a-4fdb-9194-2e761caabed6] **OPENED** 

TcpConnection wrapped interceptor publish TcpConnectionOpenEvent whose connection factory property is "unknown". I think that this connection factory property should be "client1". Is it why? (The version of Spring Integration is 4.3.12.)

Editted from here

Other TcpConnectionEvents' connection factory property seem correct. For example, TcpConnectionCloseEvent log is below.

TcpConnectionCloseEvent with TcpConnection wrapped Interceptor↓
20:26:54.009 [main] DEBUG com.neriudon.example.tcp.listener.TcpConnectionEventsListener - ★CLOSE★ TcpConnectionCloseEvent [source=TcpNetConnection:localhost:50001:53828:ec63181f-3db1-478b-8a38-160a431a8887], [factory=client1, connectionId=localhost:50001:53828:ec63181f-3db1-478b-8a38-160a431a8887] **CLOSED** 

TcpConnectionCloseEvent with raw TcpConnection↓
20:26:54.021 [main] DEBUG com.neriudon.example.tcp.listener.TcpConnectionEventsListener - ★CLOSE★ TcpConnectionCloseEvent [source=TcpNetConnection:localhost:50002:53829:4e02e3cc-7eb8-4e5d-a41a-2e6ff99518aa], [factory=client2, connectionId=localhost:50002:53829:4e02e3cc-7eb8-4e5d-a41a-2e6ff99518aa] **CLOSED** 
1

1 Answers

0
votes

It's a bug; the connection factory name is not propagated to the interceptor.

Please open a JIRA Issue.