components-contrib icon indicating copy to clipboard operation
components-contrib copied to clipboard

rocketmq pubsub error.

Open naah69 opened this issue 3 years ago • 1 comments

Expected Behavior

rocketmq pubsub

publish message work and consumer only get one every time.

Actual Behavior

publish: it error when publish message,but i can get many message(size of queue count, my expect is one message) on rocketmq console. image image

image

consumer:get all queue message.there is one message enough. image image

Steps to Reproduce the Problem

the doc https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-rocketmq/ to reproduce.

Envirement.

dapr cli: 1.8.0 dapr runtime: 1.8.3 rocketmq: 4.4.0

naah69 avatar Aug 11 '22 02:08 naah69

@ItalyPaleAle can u check it?

naah69 avatar Aug 11 '22 03:08 naah69

The unit of the sendTimeOut(Spec metadata fields: sendTimeOut)is nanosecond. you need to configure it like this: value: 3000000000. please check it. E6BD2255-34C9-443F-823D-B241857B8AAE

jinjianfeng-chn avatar Aug 17 '22 03:08 jinjianfeng-chn

rocketmq go-client will retry on failure, and dapr rocketmq component will also retry on failure. Your message send timed out, so retry actions have occurred for both rocketmq go-client and dapr rocketmq component. But message was actually sent successfully. That's why you get multiple messages. You can read the source code to prove it

B90B0831-7B83-4DC7-959C-FC8A69D98577 DE741771-8854-4872-B803-E70C3CCA35C8

jinjianfeng-chn avatar Aug 17 '22 03:08 jinjianfeng-chn

ok and thanks,it worked,but i find new problem that is rocketmq event had packaged duplicate.

rocketmq: image

redis: 71QurIJNGA

naah69 avatar Aug 25 '22 06:08 naah69

Please look at the source content in the screenshot. If rawPayload == false, The data content will be replaced with CloudEvent. What Cloudevent is serialized by JSON is what you send. 5BF75CFF-8D68-4DAD-8B02-0BFCAF6725BC

You can close it this way on this side. http: ?metadata.rocketmq-key=dapr_test&metadata.rawPayload=true grpc go: if err := client.PublishEvent(ctx, pubsubName, topicName, data, func(request *pb.PublishEventRequest) { request.Metadata["rawPayload"] = "true" }); err != nil { panic(err) }

jinjianfeng-chn avatar Aug 25 '22 12:08 jinjianfeng-chn

Please look at the source content in the screenshot. If rawPayload == false, The data content will be replaced with CloudEvent. What Cloudevent is serialized by JSON is what you send. 5BF75CFF-8D68-4DAD-8B02-0BFCAF6725BC

You can close it this way on this side. http: ?metadata.rocketmq-key=dapr_test&metadata.rawPayload=true grpc go: if err := client.PublishEvent(ctx, pubsubName, topicName, data, func(request *pb.PublishEventRequest) { request.Metadata["rawPayload"] = "true" }); err != nil { panic(err) }

it work! thank you very much!

naah69 avatar Aug 26 '22 07:08 naah69