<transformer> definitions. However if the custom transformer handler implementation should
be scoped to a single definition of the <transformer>, you can define an inner bean definition:
<transformer>
configuration is not allowed, as it creates an ambiguous condition and will result in an Exception being thrown.
@Header and @Headers parameter annotations respectively. The return value of the method can be
any type. If the return value is itself a null.
Returning null will result in an exception since a Message Transformer should always be expected to
transform each source Message into a valid target Message. In other words, a Message Transformer should not be used
as a Message Filter since there is a dedicated <filter> option for that. However, if you do need this type of
behavior (where a component might return NULL and that should not be considered an error), a
requires-reply value is FALSE by default,
but that can be set to TRUE in order to have Exceptions thrown for NULL return values as with the transformer.
toString()
on the inbound payload. There are two exceptions to this (since 3.0): if the payload is a char[],
it invokes new String(payload); if the payload is a byte[], it invokes
new String(payload, charset), where charset is "UTF-8" by default. The
charset can be modified by supplying the {person.name=George, person.child.name=Jenna, person.child.nickNames[0]=Bimbo . . . etc}
object-mapper attribute references an instance of a new
strategy interface object-to-json-transformer sets the application/json, by default, if the input message does not already have that header
present.
application/json), use the content-type
attribute. If you wish to suppress the setting of the header, set the content-type
attribute to an empty string (""). This will result in a message with no content-type
header, unless such a header was present on the input message.
->object-to-json-transformer->amqp-outbound-adapter---->
---->amqp-inbound-adapter->json-to-object-transformer->
byte[] payload instead of
String, which was the case with earlier versions.
spring-amqp 1.1.3 or
above.
header-names attribute. That attribute accepts the names of the header(s) (delimited by commas if there are multiple)
that need to be removed. So, in the above example the headers named 'lastName' and 'state' will not be present on the outbound Message.