File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
docs/high-performance/message-queue Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -265,15 +265,15 @@ acks 的默认值即为 1,代表我们的消息被 leader 副本接收之后
265265```
266266其中 BackOffExecution.STOP 的值为-1,nextBackOff 的值调用 BackOff 类的 nextBackOff() 函数。如果当前执行次数大于最大执行次数则返回 STOP,既超过这个最大执行次数后才会停止重试。
267267``` Java
268- public long nextBackOff() {
269- this . currentAttempts++ ;
270- if (this . currentAttempts <= getMaxAttempts()) {
271- return getInterval();
272- }
273- else {
274- return STOP ;
275- }
276- }
268+ public long nextBackOff() {
269+ this . currentAttempts++ ;
270+ if (this . currentAttempts <= getMaxAttempts()) {
271+ return getInterval();
272+ }
273+ else {
274+ return STOP ;
275+ }
276+ }
277277```
278278那么这个 getMaxAttempts 的值又是多少呢?回到最开始,当执行出错会进入 DefaultErrorHandler 。DefaultErrorHandler 默认的构造函数是:
279279``` Java
You can’t perform that action at this time.
0 commit comments