INT-4047: TCP: Add contentType Header

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

Polishing - PR Comments
This commit is contained in:
Gary Russell
2016-06-06 17:12:15 -04:00
committed by Artem Bilan
parent ae0939d55f
commit 08718d1919
4 changed files with 134 additions and 6 deletions

View File

@@ -1456,15 +1456,25 @@ The framework includes acknowledgment information in the data packet.
| ip_actualConnectionId
| ACTUAL_ CONNECTION_ID
| For information only - when using a cached or failover client connection factory, contains the actual underlying connection id.
| contentType
| MessageHeaders.CONTENT_TYPE
| An optional content type for inbound messages; see below.
|===
For inbound messages, `ip_hostname`, `ip_address`, `ip_tcp_remotePort` and `ip_connectionId` are mapped by the default
`TcpHeaderMapper`.
Users can add additional headers by subclassing `TcpHeaderMapper`, overriding the method `supplyCustomHeaders`, and
providing an instance to the connection factory using the `mapper` property.
Set the mapper's `addContentTypeHeader` property to `true` and the mapper will set the `contentType` header (`application/octet-stream;charset="UTF-8"`) by default.
You can change the default by setting the `contentType` property.
Users can add additional headers by subclassing `TcpHeaderMapper` and overriding the method `supplyCustomHeaders`.
For example, when using SSL, properties of the `SSLSession` can be added by obtaining the session object from the
`TcpConnection` object which is provided as an argument to the `supplyCustomHeaders` method.
For outbound messages, `String` payloads are converted to `byte[]` using the default (`UTF-8`) charset.
Set the `charset` property to change the default.
When customizing the mapper properties, or subclassing, declare the mapper as a bean and provide an instance to the connection factory using the `mapper` property
[[ip-annotation]]
=== Annotation-Based Configuration

View File

@@ -120,6 +120,11 @@ pooling of the raw buffer into which the data is received, rather than creating
message.
See <<connection-factories>> for more information.
===== TCP Message Mapper
The message mapper now, optionally, sets a configured content type header.
See <<ip-msg-headers>> for more information.
==== File Changes
===== Destination Directory Creation