-
Notifications
You must be signed in to change notification settings - Fork 615
Content type conversion matrix
Oleg Zhurakousky edited this page Jan 24, 2018
·
18 revisions
This page documents the expectation one must have when producing and consuming messages via Spring Cloud Stream channel-based binders (i.e., Kafka, Rabbit)
- The payloads of messages "on-the-wire" is represented as
byte[]
while "in-binder/in-jvm" it could be anything.-
toMessage(..) ->
byte[]
-
fromMessage(..) ->
<?>
(specific to the nature of given MessageConverter)
-
toMessage(..) ->
- Binders perform serialization (producer) and deserialization (consumer) of payload from/to
byte[]
utilizing MessageConverters. - There are 6 MessageConverters configured by default (see below - in order):
- TupleJsonMessageConverter - converts to/from Spring Tuple
- ByteArrayMessageConverter - tbd
- ObjectStringMessageConverter - tbd
- JavaSerializationMessageConverter (DEPRECATED) - tbd
- KryoMessageConverter (DEPRECATED) - tbd
- JsonUnmarshallingMessageConverter - tbd
Below is the list of content types supported by the provided MessageConverters
- application/json
-
application/x-java-object (must contain
type
attribute with FQN of the actual type:application/x-java-object; type=foo.bar.MyClass
) - application/x-java-serialized-object
- application/x-spring-tuple