Class ConvertingBytesMessageMapper
java.lang.Object
org.springframework.integration.mapping.ConvertingBytesMessageMapper
- All Implemented Interfaces:
BytesMessageMapper
,InboundMessageMapper<byte[]>
,OutboundMessageMapper<byte[]>
The
BytesMessageMapper
implementation to delegate to/from Message
conversion into the provided MessageConverter
.
The MessageConverter
must not return null
from its
MessageConverter.fromMessage(Message, Class)
and MessageConverter.toMessage(Object, MessageHeaders)
methods.
If MessageConverter.fromMessage(Message, Class)
returns String
, it is converted to byte[]
using a StandardCharsets.UTF_8
encoding.
- Since:
- 5.4
- Author:
- Artem Bilan
-
Constructor Details
-
ConvertingBytesMessageMapper
-
-
Method Details
-
toMessage
Description copied from interface:InboundMessageMapper
Convert a provided object to theMessage
and supply with headers if necessary and provided.- Specified by:
toMessage
in interfaceBytesMessageMapper
- Specified by:
toMessage
in interfaceInboundMessageMapper<byte[]>
- Parameters:
bytes
- the object for message payload or some other conversion logicheaders
- additional headers for building message. Can be null- Returns:
- the message as a result of mapping
-
fromMessage
- Specified by:
fromMessage
in interfaceOutboundMessageMapper<byte[]>
-