GitHub user mz0113 closed a discussion: 求教 v5.1.0 事务消息Broker回查check()逻辑中 
isNeedCheck方法到底要表达什么意思呢?

```java
                        boolean isNeedCheck = opMsg == null && 
valueOfCurrentMinusBorn > checkImmunityTime
                            || opMsg != null && opMsg.get(opMsg.size() - 
1).getBornTimestamp() - startTime > transactionTimeout
                            || valueOfCurrentMinusBorn <= -1;
```
就上面这个代码 , 第一和第三个条件好理解,第二个条件理解不了
如果opMsg不空,并且最后也就是当前拉取的最后一条opMsg的bornTime距离事务开始时间已经过去transactionTimeout秒的话,那就发起回查.
 可是我们之前只拉了max 32条op消息 , 有可能第33条就是所需的opMsg , 此时发起回查岂不是浪费了资源 . 
难道不应该是判断整个opQueue此时此刻的最新消息么 , 为什么可以仅仅根据当前拉出来的32条就笃定没有所需opMsg,需要回查.


GitHub link: https://github.com/apache/rocketmq/discussions/7244

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to