xox9001 edited a comment on issue #657: query new topic first message fail,but 
message list have message
URL: https://github.com/apache/rocketmq/issues/657#issuecomment-451243786
 
 
   > config := new(rocketmq.ProducerConfig)
   >    config.GroupID = "testGroup"
   >    config.NameServer = "localhost:9876"
   > 
   >    producer,error := rocketmq.NewProducer(config)
   > 
   >    if error != nil {
   >            fmt.Println(error)
   >    }
   > 
   >    producer.Start()
   >    defer producer.Shutdown()
   >    fmt.Printf("Producer: %s started... \n", producer)
   >    var i= 0
   >    //for {
   > 
   >            msg := fmt.Sprintf("Hello RocketMQ-%d", i)
   >            msgT := new(rocketmq.Message)
   >            msgT.Topic = "orderlyTest"
   >            msgT.Body = "msg,I:"+strconv.Itoa(i)
   >            msgT.DelayTimeLevel = 1
   >            //msgT.Keys = strconv.Itoa(i)
   >            //msgT.Tags = "test"
   >            //result,err := producer.SendMessageSync(msgT)
   >            selector := queueSelectorByOrderID{}
   >            result,err := producer.SendMessageOrderly(msgT,selector,4,3)
   > 
   >            if err != nil {
   >                    fmt.Println(err)
   >            }
   > 
   >            //fmt.Println(fmt.Sprintf("send message: %s result: %s", msg, 
result))
   >            glog.Infof("send message: %s result: %s", msg, result)
   >            time.Sleep(1 * time.Second)
   >            i++
   >    //}
   > 
   >    //producer.Shutdown() 981FA8C0000066120000C0EFB6140100
   >    return

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to