wo3002807 commented on PR #3928:
URL: https://github.com/apache/rocketmq/pull/3928#issuecomment-1108008843
> ```
> public boolean consumed(final MessageExt msg,
> final String group) throws RemotingException, MQClientException,
InterruptedException,
> MQBrokerException {
>
> ConsumeStats cstats = this.examineConsumeStats(group);
>
> ClusterInfo ci = this.examineBrokerClusterInfo();
>
> Iterator<Entry<MessageQueue, OffsetWrapper>> it =
cstats.getOffsetTable().entrySet().iterator();
> while (it.hasNext()) {
> Entry<MessageQueue, OffsetWrapper> next = it.next();
> MessageQueue mq = next.getKey();
> if (mq.getTopic().equals(msg.getTopic()) && mq.getQueueId() ==
msg.getQueueId()) {
> BrokerData brokerData =
ci.getBrokerAddrTable().get(mq.getBrokerName());
> if (brokerData != null) {
> String addr =
RemotingUtil.convert2IpString(brokerData.getBrokerAddrs().get(MixAll.MASTER_ID));
> if
(RemotingUtil.socketAddress2String(msg.getStoreHost()).equals(addr)) {
> if (next.getValue().getConsumerOffset() >
msg.getQueueOffset()) {
> return true;
> }
> }
> }
> }
> }
>
> return false;
> }
> ```
>
> I think the whole method logic could be simplified based on your changes.
ok. i need to commit a merge request again.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]