INT-3800: Expose Actual Port Chosen When Random

JIRA: https://jira.spring.io/browse/INT-3800

If the server port is 0, return the actual port after the factory is started.

Also add more TCP Test Diagnostics.
This commit is contained in:
Gary Russell
2015-08-12 17:58:07 -04:00
committed by Artem Bilan
parent 4ab25121af
commit bcfc4d88c1
8 changed files with 159 additions and 17 deletions

View File

@@ -166,6 +166,11 @@ A simple server connection factory that uses `java.net.Socket` connections.
A simple server connection factory that uses `java.nio.channel.SocketChannel` connections.
NOTE: Starting with Spring Integration _version 4.2_, if the server is configured to listen on a random port (0),
the actual port chosen by the OS can be obtained using `getPort()`.
Also, `getServerSocketAddress()` is available to get the complete `SocketAddress`.
See the javadocs for the `TcpServerConnectionFactory` interface for more information.
[source,xml]
----
<int-ip:tcp-connection-factory id="client"

View File

@@ -145,6 +145,15 @@ If you are using the serializers directly within user code, you may have to `flu
`TcpConnectionServerExceptionEvent` s are now published whenever an unexpected exception occurs on a TCP server socket (also added to 4.1.3, 4.0.7).
See <<tcp-events>> for more information.
[[x4.2-tcp-server-port]]
===== TCP Server Port
If a TCP server socket factory is configured to listen on a random port, the actual port chosen by the OS can now
be obtained using `getPort()`.
`getServerSocketAddress()` is also available.
See <<connection-factories>> for more information.
[[x4.2-tcp-gw-rto]]
===== TCP Gateway Remote Timeout