You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See #2837
Give priority to accepting new connections over reading data from
existing connections.
Add a flag to allow users to revert to the previous behavior of
giving reads priority.
**cherry-pick to 5.1.x**
# Conflicts:
# spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java
# src/reference/asciidoc/whats-new.adoc
# TcpNioConnectionTests.java
Copy file name to clipboardExpand all lines: spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -476,6 +476,7 @@ public void setSslHandshakeTimeout(int sslHandshakeTimeout) {
476
476
* @see #setSslHandshakeTimeout(int)
477
477
* @since 4.3.6
478
478
*/
479
+
@Nullable
479
480
protectedIntegergetSslHandshakeTimeout() {
480
481
returnthis.sslHandshakeTimeout;
481
482
}
@@ -724,7 +725,7 @@ else if (key.isAcceptable()) {
724
725
doAccept(selector, server, now);
725
726
}
726
727
catch (Exceptione) {
727
-
logger.error("Exception accepting new connection", e);
728
+
logger.error("Exception accepting new connection(s)", e);
Copy file name to clipboardExpand all lines: spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java
Copy file name to clipboardExpand all lines: spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionTests.java
Copy file name to clipboardExpand all lines: src/reference/asciidoc/ip.adoc
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -971,6 +971,10 @@ Alternatively, you can insert a resequencer downstream of the inbound endpoint t
971
971
If you set `apply-sequence` to `true` on the connection factory, messages arriving on a TCP connection have `sequenceNumber` and `correlationId` headers set.
972
972
The resequencer uses these headers to return the messages to their proper sequence.
973
973
974
+
IMPORTANT: Starting with version 5.1.4, priority is given to accepting new connections over reading from existing connections.
975
+
This should, generally, have little impact unless you have a very high rate of new incoming connections.
976
+
If you wish to revert to the previous behavior of giving reads priority, set the `multiAccept` property on the `TcpNioServerConnectionFactory` to `false`.
0 commit comments