INT-3295 Datatype Channel : Use MessageConverter
JIRA: https://jira.springsource.org/browse/INT-3295 Instead of invoking the conversion service directly, do it via a MessageConverter (DefaultDatatypeChannelMessageConverter). That way, users can override the MessageConverter; for example, XD wants to look at the content-type header during the conversion process (and update the content-type). INT-3295 Polishing PR Comments.
This commit is contained in:
committed by
Artem Bilan
parent
814caea5d5
commit
25489adaa3
@@ -509,6 +509,18 @@ payload to an Integer.
|
||||
For more information regarding Payload Type Conversion, please read <xref linkend="payload-type-conversion"/>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Beginning with <emphasis>version 4.0</emphasis>, the <code>integrationConversionService</code> is invoked
|
||||
by the <classname>DefaultDatatypeChannelMessageConverter</classname>, which looks up the conversion
|
||||
service in the application context. To use a different conversion technique, you can specify the
|
||||
<code>message-converter</code> attribute on the channel. This must be a reference to a
|
||||
<interfacename>MessageConverter</interfacename> implementation.
|
||||
Only the <code>fromMessage</code> method is used, which provides the
|
||||
converter with access to the message headers (for example if the conversion might need information
|
||||
from the headers, such as <code>content-type</code>). The method can return just the converted
|
||||
payload, or a full <classname>Message</classname> object. If the latter, the converter must
|
||||
be careful to copy all the headers from the inbound message.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="channel-configuration-queuechannel">
|
||||
|
||||
@@ -89,5 +89,13 @@
|
||||
considered for outbound messages. For more information see <xref linkend="jms-header-mapping"/>.
|
||||
</para>
|
||||
</section>
|
||||
<section id="4.0-datatype-channel">
|
||||
<title>Datatype Channels</title>
|
||||
<para>
|
||||
You can now specify a <interfacename>MessageConverter</interfacename> to be used when converting
|
||||
(if necessary) payloads to one of the accepted <code>datatype</code>s in a Datatype channel.
|
||||
For more information see <xref linkend="channel-datatype-channel"/>.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
Reference in New Issue
Block a user