Skip to content

Commit dd3638d

Browse files
committed
update kafka-questions-01.md
1 parent 771386d commit dd3638d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/high-performance/message-queue/kafka-questions-01.md

+9-9
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)