storezhang opened a new issue #509:
URL: https://github.com/apache/rocketmq-client-go/issues/509


   版本:2.1.0-rc4
   表现:
   
![image](https://user-images.githubusercontent.com/4278758/87138120-8b0b9680-c2d0-11ea-9763-67f4589adae0.png)
   代码
   `
   consumer, err = rocketmq.NewPushConsumer(
                        consumer.WithCredentials(primitive.Credentials{
                                AccessKey: n.AccessKey,
                                SecretKey: n.SecretKey,
                        }),
                        consumer.WithGroupName(n.Group),
                        consumer.WithNameServer(n.Endpoints),
                        consumer.WithNamespace(n.Namespace),
                        consumer.WithAutoCommit(true),
                        consumer.WithRetry(100),
                        // 每次只消费一条数据
                        consumer.WithConsumeMessageBatchMaxSize(1),
                )
   
   consumer.Subscribe(
                n.Topic,
                selector,
                func(ctx context.Context, messages ...*primitive.MessageExt) 
(consumer.ConsumeResult, error) {
                        if 1 != len(messages) {
                                return consumer.ConsumeRetryLater, nil
                        }
   
                        return consumer.ConsumeSuccess, nil
                },
        )
   `


----------------------------------------------------------------
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.

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


Reply via email to