INT-3425: Deprecate TCP Event Channel Adapter

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

Deprecate `TcpConnectionEventListeningMessageProducer` in favor
of using a generic event inbound channel adapter.

Polishing
This commit is contained in:
Gary Russell
2015-07-13 18:40:16 -04:00
committed by Artem Bilan
parent 583d432f22
commit f1fc0edbf3
11 changed files with 45 additions and 21 deletions

View File

@@ -5,7 +5,7 @@
==== Introduction
At times you may have a requirement to enhance a request with more information than was provided by the target system.
Thehttp://www.eaipatterns.com/DataEnricher.html[Content Enricher] pattern describes various scenarios as well as the component (Enricher), which allows you to address such requirements.
The http://www.eaipatterns.com/DataEnricher.html[Content Enricher] pattern describes various scenarios as well as the component (Enricher), which allows you to address such requirements.
The Spring Integration `Core` module includes 2 enrichers:

View File

@@ -355,12 +355,19 @@ Configuring a connection interceptor factory chain.
Beginning with version 3.0, changes to `TcpConnection` s are reported by `TcpConnectionEvent` s.
`TcpConnectionEvent` is a subclass of `ApplicationEvent` and thus can be received by any `ApplicationListener` defined in the `ApplicationContext`.
[NOTE]
=====
The following is deprecated as of _version 4.2_; use the generic Event Inbound Channel Adapter instead.
See <<applicationevent-inbound>>.
For convenience, a `<int-ip:tcp-connection-event-inbound-channel-adapter/>` is provided.
This adapter will receive all `TcpConnectionEvent` s (by default), and send them to its `channel`.
The adapter accepts an `event-type` attribute, which is a list of class names for events that should be sent.
This can be used if an application subclasses `TcpConnectionEvent` for some reason, and wishes to only receive those events.
Omitting this attribute will mean that all `TcpConnectionEvent` s will be sent.
You can also use this to limit which `TcpConnectionEvent` s you are interested in ( `TcpConnectionOpenEvent`, `TcpConnectionCloseEvent`, or `TcpConnectionExceptionEvent`).
=====
`TcpConnectionEvents` have the following properties:

View File

@@ -367,18 +367,19 @@ Also see <<advising-with-annotations>>.
==== Header Filter
Some times your transformation use case might be as simple as removing a few headers.
For such a use case, Spring Integration provides a _Header Filter_which allows you to specify certain header names
that should be removed from the output Message (e.g.
for security reasons or a value that was only needed temporarily).Basically the _Header Filter_is the opposite of the _Header Enricher_.
The latter is discussed in <<header-enricher>>[source,xml]
For such a use case, Spring Integration provides a _Header Filter_ which allows you to specify certain header names
that should be removed from the output Message (e.g. for security reasons or a value that was only needed temporarily).
Basically, the _Header Filter_ is the opposite of the _Header Enricher_.
The latter is discussed in <<header-enricher>>.
[source,xml]
----
<int:header-filter input-channel="inputChannel"
output-channel="outputChannel" header-names="lastName, state"/>
----
As you can see, configuration of a _Header Filter_is quite simple.
It is a typical endpoint with input/output channels
and a `header-names` attribute.
As you can see, configuration of a _Header Filter_ is quite simple.
It is a typical endpoint with input/output channels and a `header-names` attribute.
That attribute accepts the names of the header(s) (delimited by commas if there are multiple)
that need to be removed.
that need to be removed.
So, in the above example the headers named 'lastName' and 'state' will not be present on the outbound Message.

View File

@@ -126,7 +126,11 @@ See <<ip-msg-headers>> for more information.
===== 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.
non-existent socket.
The `TcpConnectionEventListeningMessageProducer` is deprecated; use the generic event adapter instead.
See <<tcp-events>> for more information.
[[x4.2-inbound-channel-adapter-annotation]]
==== @InboundChannelAdapter