apache / apache/rocketmq-client-go
How to get MaxOffset
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 445
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I want to implement a rocketmq scaler in KEDA, which is intended to get the Lag by calculating the offset in the mq, but I don't find any exported API in the SDK for getting maxOffset, then I find this issue #1167 , and I found this API meet our need:
```go
consumer/consumer.go
1000:func (dc *defaultConsumer) queryMaxOffset(mq *primitive.MessageQueue) (int64, error) {
1001- brokerAddr := dc.client.GetNameSrv().FindBrokerAddrByName(mq.BrokerName)
1002- if brokerAddr == "" {
1003- dc.client.GetNameSrv().UpdateTopicRouteInfo(mq.Topic)
1004- brokerAddr = dc.client.GetNameSrv().FindBrokerAddrByName(mq.BrokerName)
1005- }
```
and I want to know is it ok to add API for getting maxOffset.
Contributor guide
Assessment
This issue has not been assessed yet.