对于最新稳定版本,请使用spring-cloud-stream 5.0.1spring-doc.cadn.net.cn

内容类型协商

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.cadn.net.cn

  1. 转换传入消息的内容,使其符合应用程序提供的处理程序的签名。spring-doc.cadn.net.cn

  2. 将传出消息的内容转换为线路格式。spring-doc.cadn.net.cn

协议格式通常为byte[](这是Kafka和Rabbit绑定程序的默认值),但它受绑定程序实现的控制。spring-doc.cadn.net.cn

在Spring Cloud Stream中,消息转换是通过一个org.springframework.messaging.converter.MessageConverter来完成的。spring-doc.cadn.net.cn

微服推述中,spring 有写逻; spring mvc 是 spring 一部分,spring boot 是 springmvc 的一种曲线发射,spring cloud 是 spring boot 的一种服务