-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6e9f45
commit fc4907d
Showing
7 changed files
with
49 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
import org.springframework.core.serializer.Serializer; | ||
import org.springframework.integration.ip.IpHeaders; | ||
import org.springframework.integration.support.AbstractIntegrationMessageBuilder; | ||
import org.springframework.lang.Nullable; | ||
import org.springframework.messaging.Message; | ||
import org.springframework.util.Assert; | ||
|
||
|
@@ -147,7 +148,7 @@ public void registerSender(TcpSender sender) { | |
} | ||
} | ||
|
||
@Override // NOSONAR | ||
@Override | ||
protected TcpConnectionSupport obtainConnection() throws InterruptedException { | ||
FailoverTcpConnection sharedConnection = (FailoverTcpConnection) getTheConnection(); | ||
boolean shared = !isSingleUse() && !this.cachingDelegates; | ||
|
@@ -170,16 +171,18 @@ protected TcpConnectionSupport obtainConnection() throws InterruptedException { | |
return failoverTcpConnection; | ||
} | ||
|
||
private void closeRefreshedIfNecessary(FailoverTcpConnection sharedConnection, boolean refreshShared, | ||
private void closeRefreshedIfNecessary(@Nullable FailoverTcpConnection sharedConnection, boolean refreshShared, | ||
FailoverTcpConnection failoverTcpConnection) { | ||
|
||
this.creationTime = System.currentTimeMillis(); | ||
/* | ||
* We may have simply wrapped the same connection in a new wrapper; don't close. | ||
*/ | ||
if (refreshShared && this.closeOnRefresh | ||
&& sharedConnection != null | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
artembilan
Author
Member
|
||
&& !sharedConnection.delegate.equals(failoverTcpConnection.delegate) | ||
&& sharedConnection.isOpen()) { | ||
|
||
sharedConnection.close(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@artembilan This is unnecessary;
refreshShared
will always be false if this is false. Shortcoming of sonar logic (not unreasonable though).This should be a
// NOSONAR
instead.