Fix AbstractCF around sender property

The `senders` list was introduced starting version `5.4`
This commit is contained in:
Artem Bilan
2022-01-03 13:05:32 -05:00
parent f907a15c16
commit b4a56e60b8

View File

@@ -552,7 +552,9 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport
TcpConnection connection = iterator.next().getValue();
connection.close();
iterator.remove();
getSenders().forEach(sender -> sender.removeDeadConnection(connection));
if (this.sender != null) {
this.sender.removeDeadConnection(connection);
}
}
}
synchronized (this.lifecycleMonitor) {
@@ -843,8 +845,10 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport
TcpConnectionSupport connection = entry.getValue();
if (!connection.isOpen()) {
iterator.remove();
getSenders().forEach(sender -> sender.removeDeadConnection(connection));
if (this.sender != null) {
this.sender.removeDeadConnection(connection);
}
if (logger.isDebugEnabled()) {
logger.debug(getComponentName() + ": Removed closed connection: " +
connection.getConnectionId());
@@ -926,7 +930,9 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport
try {
connection.close();
closed = true;
getSenders().forEach(sender -> sender.removeDeadConnection(connection));
if (this.sender != null) {
this.sender.removeDeadConnection(connection);
}
}
catch (Exception e) {
if (logger.isDebugEnabled()) {