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 2021/06/19 10:07:44 UTC

[GitHub] [rocketmq-client-go] happylhb opened a new issue #685: ConsumeTimestamp选项无法设置,导致ConsumeFromTimestamp没有意义

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


   consumer.WithConsumeFromWhere(consumer.ConsumeFromTimestamp) 但无法设置ConsumeTimestamp
   通过代码来看,也没有计算最近半小时的选择
   
   ```golang
   //consumer/consumer.go  line:784
   
   case ConsumeFromTimestamp:
   	if lastOffset == -1 {
   		if strings.HasPrefix(mq.Topic, internal.RetryGroupTopicPrefix) {
   			lastOffset, err := dc.queryMaxOffset(mq)
   			if err == nil {
   				result = lastOffset
   			} else {
   				result = -1
   				rlog.Warning("query max offset error", map[string]interface{}{
   					rlog.LogKeyMessageQueue:  mq,
   					rlog.LogKeyUnderlayError: err,
   				})
   			}
   		} else {
   			t, err := time.Parse("20060102150405", dc.option.ConsumeTimestamp)
   			if err != nil {
   				result = -1
   			} else {
   				lastOffset, err := dc.searchOffsetByTimestamp(mq, t.Unix()*1000)
   				if err != nil {
   					result = -1
   				} else {
   					result = lastOffset
   				}
   			}
   		}
   	}
   default:
   
   ```


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



[GitHub] [rocketmq-client-go] ShannonDing closed issue #685: ConsumeTimestamp选项无法设置,导致ConsumeFromTimestamp没有意义

Posted by GitBox <gi...@apache.org>.
ShannonDing closed issue #685:
URL: https://github.com/apache/rocketmq-client-go/issues/685


   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq-client-go] maixiaohai commented on issue #685: ConsumeTimestamp选项无法设置,导致ConsumeFromTimestamp没有意义

Posted by GitBox <gi...@apache.org>.
maixiaohai commented on issue #685:
URL: https://github.com/apache/rocketmq-client-go/issues/685#issuecomment-866997494


   try this https://github.com/apache/rocketmq-client-go/issues/681
   you can set consumer offset by timestamp through console


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