georgehao commented on code in PR #803:
URL: https://github.com/apache/rocketmq-client-go/pull/803#discussion_r851025962


##########
producer/producer.go:
##########
@@ -150,6 +151,113 @@ func MarshalMessageBatch(msgs ...*primitive.Message) 
[]byte {
        return buffer.Bytes()
 }
 
+func (p *defaultProducer) prepareSendRequest(msg *primitive.Message, ttl 
time.Duration) (string, error) {
+       correlationId := uuid.NewV4().String()
+       requestClientId := p.client.ClientID()
+       msg.WithProperty(primitive.PropertyCorrelationID, correlationId)
+       msg.WithProperty(primitive.PropertyMessageReplyToClient, 
requestClientId)
+       msg.WithProperty(primitive.PropertyMessageTTL, 
strconv.Itoa(int(ttl.Seconds())))
+
+       rlog.Debug("message info:", map[string]interface{}{
+               "clientId":      requestClientId,
+               "correlationId": correlationId,
+               "ttl":           ttl.Seconds(),
+       })
+
+       nameSrv, err := internal.GetNamesrv(requestClientId)
+       if err != nil {
+               return "", errors.Wrap(err, "GetNameServ err")
+       }
+
+       if !nameSrv.CheckTopicRouteHasTopic(msg.Topic) {

Review Comment:
   这个是Java的逻辑实现。DefaultMQProducerImpl.java:L1595。看下是否还需要这个逻辑



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to