INT-3745: More TCP Events (Failed Correlation)

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

Emit events whenever a message is received that can't be correlated to
a connection (or request in the case of an outbound gateway).

Also, when sending messages, wrap the exception in a `MessagingException` so that
the `TcpConnectionExceptionEvent` provides access to the failed message.

INT-3745: Polishing - PR Comments

Fix JavaDocs errors
This commit is contained in:
Gary Russell
2015-06-17 13:38:11 -04:00
committed by Artem Bilan
parent 65d2024937
commit f4104c199a
11 changed files with 289 additions and 23 deletions

View File

@@ -373,9 +373,15 @@ In addition, since _version 4.0_ the standard deserializers discussed in <<conne
These events contain the exception, the buffer that was in the process of being built, and an offset into the buffer (if available) at the point the exception occurred.
Applications can use a normal `ApplicationListener`, or see <<applicationevent-inbound>>, to capture these events, allowing analysis of the problem.
Starting with _versions 4.0.7, 4.1.3_`TcpConnectionServerExceptionEvent` s are published whenever an unexpected exception occurs on a server socket (such as a `BindException` when the server socket is in use).
Starting with _versions 4.0.7, 4.1.3_, `TcpConnectionServerExceptionEvent` s are published whenever an unexpected exception occurs on a server socket (such as a `BindException` when the server socket is in use).
These events have a reference to the connection factory and the cause.
Starting with _version 4.2_, `TcpConnectionFailedCorrelationEvent` s are published whenever an endpoint (inbound gateway or
collaborating outbound channel adapter) receives a message that cannot be routed to a connection because the
`ip_connectionId` header is invalid.
Outbound gateways also publish this event when a late reply is received (the sender thread has timed out).
The event contains the connection id as well as an exception in the `cause` property that contains the failed message.
[[tcp-adapters]]
=== TCP Adapters

View File

@@ -63,20 +63,22 @@ See <<files>> for more information.
The `ScatterGatherHandler` class has been moved from the `org.springframework.integration.handler` to the `org.springframework.integration.scattergather`.
==== TCP Changes
[[x4.2-tcp-serializers]]
==== TCP Serializers
===== TCP Serializers
The TCP `Serializers` no longer `flush()` the `OutputStream`; this is now done by the `TcpNxxConnection` classes.
If you are using the serializers directly within user code, you may have to `flush()` the `OutputStream`.
[[x4.2-tcp-server-exceptions]]
==== Server Socket Exceptions
===== Server Socket Exceptions
`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-gw-rto]]
==== TCP Gateway Remote Timeout
===== TCP Gateway Remote Timeout
The `TcpOutboundGateway` now supports `remote-timeout-expression` as an alternative to the existing `remote-timeout` attribute.
This allows setting the timeout based on each message.
@@ -86,7 +88,7 @@ Also, the `remote-timeout` no longer defaults to the same value as `reply-timeou
See <<tcp-ob-gateway-attributes>> for more information.
[[x4.2-tcp-ssl]]
==== TCP SSLSession Available for Header Mapping
===== TCP SSLSession Available for Header Mapping
`TcpConnection` s now support `getSslSession()` to enable users to extract information from the session to add to
message headers.
@@ -94,6 +96,12 @@ message headers.
See <<ip-msg-headers>> for more information.
[[x4.2-tcp-events]]
===== TCP Events
New events are now published whenever a correlation exception occurs - for example sending a message to a
non-existent socket. See <<tcp-events>> for more information.
[[x4.2-inbound-channel-adapter-annotation]]
==== @InboundChannelAdapter
@@ -160,9 +168,3 @@ metadata store if it implements `Flushable` (e.g. the `PropertiesPersistenMetada
When using Java 8, gateway methods can now return `CompletableFuture<?>`.
See <<gw-completable-future>> for more information.
[[x4.2-ftp-changes]]
==== (S)FTP Changes
The SFTP/FTP outbound gateway `get` operations now support the `-stream` option, allowing files to be retrieved as
a stream. See <<ftp-outbound-gateway>> and <<sftp-outbound-gateway>> for more information.