You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/08/27 08:38:10 UTC

[GitHub] [rocketmq-client-go] Me1onRind opened a new issue #183: 设置consumeMessageBatchMaxSize发现一个问题

Me1onRind opened a new issue #183: 设置consumeMessageBatchMaxSize发现一个问题
URL: https://github.com/apache/rocketmq-client-go/issues/183
 
 
   我给 consumer/option.go增加了一个方法 设置consumeMessageBatchMaxSize
   ```go
   func WithConsumeMessageBatchMaxSize(consumeMessageBatchMaxSize int) Option {
       return func(opts *consumerOptions) {
           opts.ConsumeMessageBatchMaxSize = consumeMessageBatchMaxSize
       }   
   }
   ```
   以将consumeMessageBatchMaxSize设置为1为例,启动后使用后没有什么问题,但是发现如果在不启动
   ```go
   consumer.WithConsumerOrder(true)
   ```
   的情况下,写入offset.json文件的 offset偏移量每次都只+1或者不变, 从而导致重启的时候会消费一些已经消费过的历史消息。 同时消费端还会丢一两条数据。集群模式下远程维护offset也会有这个问题。
   
   使用的操作系统是centos7, 单机测试, 一个消费进程,一个推送进程每次推送10条消息入同一个queue。
   自己简单看了下代码似乎是因为非顺序消费的时候queueCache导致的问题,consumeMessageBatchMaxSize相对每次pull下来的消息个数较小时就会发生, 如果是开启顺序消费则没有这个问题。
   不过,我不确定这是否是一个问题。

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services