Skip to content

Commit 753255c

Browse files
garyrussellartembilan
authored andcommitted
Fix ThreadAffinityClientConnectionFactory
`isSingleUse()` should return `false` by default - the whole point is to bind a connection to a thread. The TACCF should have its own flag not return the delegate's. Also, the `TcpReceivingChanneladapter` calls `closeConnection(connectionId)`. This should be a no-op for the TACCF since the proper way to close a connection is to call `releaseConnection()` on the thread to which the connection is bound. **cherry-pick to 5.0.x**
1 parent d4b7cef commit 753255c

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ThreadAffinityClientConnectionFactory.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -298,21 +298,6 @@ public void setMapper(TcpMessageMapper mapper) {
298298
this.connectionFactory.setMapper(mapper);
299299
}
300300

301-
@Override
302-
public boolean isSingleUse() {
303-
return this.connectionFactory.isSingleUse();
304-
}
305-
306-
@Override
307-
public void setSingleUse(boolean singleUse) {
308-
this.connectionFactory.setSingleUse(singleUse);
309-
}
310-
311-
@Override
312-
public void setLeaveOpen(boolean leaveOpen) {
313-
this.connectionFactory.setLeaveOpen(leaveOpen);
314-
}
315-
316301
@Override
317302
public void setInterceptorFactoryChain(TcpConnectionInterceptorFactoryChain interceptorFactoryChain) {
318303
this.connectionFactory.setInterceptorFactoryChain(interceptorFactoryChain);
@@ -370,7 +355,7 @@ public List<String> getOpenConnectionIds() {
370355

371356
@Override
372357
public boolean closeConnection(String connectionId) {
373-
return this.connectionFactory.closeConnection(connectionId);
358+
return false;
374359
}
375360

376361
@Override

0 commit comments

Comments
 (0)