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
27.91k stars 8.33k forks source link

rocketmq message id deliver #883

Open liudaomanbu opened 5 years ago

liudaomanbu commented 5 years ago

Which Component rocketmq

Is your feature request related to a problem? Please describe. rocketmq的消息中的消息id似乎没有完整的传递下去,在转换为Spring的Messsage对象时就看不到原始的rocketmq消息id了.这并不利于排查问题和追踪消费情况.

The message ID in the rocketmq message does not seem to be passed down completely. When converted to Spring's Message object, the original rocketmq message ID can not be seen. This is not conducive to problem solving and tracking consumption.

Describe the solution you'd like 将rocketmq的消息中的消息id使用Spring的Messsage对象的header传递下去. The message ID in the rocketmq message is passed down using the header of Spring's Message object.

Additional context image image 只传递了unique_key,但是id却没有传递 Only unique_key is passed, but id is not passed

zkzlx commented 5 years ago

Which version is used?

liudaomanbu commented 5 years ago

Which version is used?

master branch,2.1.1.BUILD-SNAPSHOT version. Latest version.

zkzlx commented 5 years ago

I tracked it , and think the problem should be completely resolved in rocketmq-client. If designed in this way, it should not be possible. so I think that should enhance rocketmq-spring.

Data flow guidance : org.apache.rocketmq.common.message.MessageDecoder#decode(java.nio.ByteBuffer, boolean, boolean, boolean) -> org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl#sendKernelImpl -> MessageClientIDSetter.setUniqID(msg);

Do you think? @fangjian0423

fangjian0423 commented 5 years ago

image

msgId: created by RocketMQ id in properties: we don't create it, it automatically generate by Spring Messaging with IdGenerator UNIQ_KEY in properties: created by RocketMQ

HungryPt commented 4 years ago

maybe setHeader key solve the problem

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.