alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
28k stars 8.35k forks source link

RocketMQ not support MessageConverter #885

Open liudaomanbu opened 5 years ago

liudaomanbu commented 5 years ago

Which Component RocketMQ

Is your feature request related to a problem? Please describe. https://cloud.spring.io/spring-cloud-static/Greenwich.SR2/multi/multi_content-type-management.html.

RocketMQMessageHandler发送都是用RocketMQTemplate,然后RocketMQTemplate里面序列化是写死用jackson的Mapper的,这似乎不符合Spring cloud stream的规范. 这里的说明写的是stream的message的body和http请求的body是一样的机制,有一整个list的转换器.只不过一个接口是org.springframework.messaging.converter.MessageConverter,一个接口是org.springframework.http.converter.HttpMessageConverter. 但是RocketMQTemplate是写死用jackson,没有用Spring的MessageConverter机制.

RocketMQMessageHandler uses RocketMQ Emplate to send messages, and then RocketMQ Emplate is serialized to write dead Jackson Mapper, which does not seem to conform to the Spring cloud stream specification.

The explanation here is that the body of stream message is the same mechanism as the body of HTTP request, with an entire list converter. Only one interface is org. spring framework. messaging. converter. MessageConverter, and one interface is org. spring framework. http. converter. HttpMessageConverter.

But RocketMQTemplate is a dead-end jackson, not Spring's Message Converter mechanism.

Describe the solution you'd like support MessageConverter.

Additional context https://cloud.spring.io/spring-cloud-static/Greenwich.SR2/multi/multi_content-type-management.html.

fangjian0423 commented 5 years ago

Yes, RocketMQTemplate only support Jackson to serialize payload, it need to be enhanced.

contributors are welcome. RocketMQTemplate is in RocketMQ Spring Boot Project.

fangjian0423 commented 5 years ago

Related https://github.com/apache/rocketmq-spring/issues/147.

zkzlx commented 3 years ago

please try the beta version #2029 to see if it solves your problem, or provide us more information to help find the latent bug.