pingww commented on code in PR #82:
URL: https://github.com/apache/rocketmq-mqtt/pull/82#discussion_r857054236
##########
mqtt-cs/src/main/java/org/apache/rocketmq/mqtt/cs/session/infly/MqttMsgId.java:
##########
@@ -59,22 +59,17 @@ public int nextId(String clientId) {
MsgIdEntry msgIdEntry = hashMsgID(clientId);
synchronized (msgIdEntry) {
int startingMessageId = msgIdEntry.nextMsgId;
- int loopCount = 0;
- int maxLoopCount = 1;
do {
msgIdEntry.nextMsgId++;
if (msgIdEntry.nextMsgId > MAX_MSG_ID) {
msgIdEntry.nextMsgId = MIN_MSG_ID;
}
if (msgIdEntry.nextMsgId == startingMessageId) {
- loopCount++;
- if (loopCount >= maxLoopCount) {
Review Comment:
Yes, it may be the case that maxLoopCount>1 was considered before
--
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]