This version is still in development and is not considered stable yet. For the latest stable version, please use spring-cloud-stream 4.1.4!spring-doc.cn

Content Type Negotiation

Data transformation is one of the core features of any message-driven microservice architecture. Given that, in Spring Cloud Stream, such data is represented as a Spring Message, a message may have to be transformed to a desired shape or size before reaching its destination. This is required for two reasons:spring-doc.cn

  1. To convert the contents of the incoming message to match the signature of the application-provided handler.spring-doc.cn

  2. To convert the contents of the outgoing message to the wire format.spring-doc.cn

The wire format is typically byte[] (that is true for the Kafka and Rabbit binders), but it is governed by the binder implementation.spring-doc.cn

In Spring Cloud Stream, message transformation is accomplished with an org.springframework.messaging.converter.MessageConverter.spring-doc.cn

As a supplement to the details to follow, you may also want to read the following blog post.