We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 771386d commit dd3638dCopy full SHA for dd3638d
docs/high-performance/message-queue/kafka-questions-01.md
@@ -265,15 +265,15 @@ acks 的默认值即为 1,代表我们的消息被 leader 副本接收之后
265
```
266
其中 BackOffExecution.STOP 的值为-1,nextBackOff 的值调用 BackOff 类的 nextBackOff() 函数。如果当前执行次数大于最大执行次数则返回 STOP,既超过这个最大执行次数后才会停止重试。
267
```Java
268
- public long nextBackOff() {
269
- this.currentAttempts++;
270
- if (this.currentAttempts <= getMaxAttempts()) {
271
- return getInterval();
272
- }
273
- else {
274
- return STOP;
275
276
+public long nextBackOff() {
+ this.currentAttempts++;
+ if (this.currentAttempts <= getMaxAttempts()) {
+ return getInterval();
+ }
+ else {
+ return STOP;
+}
277
278
那么这个 getMaxAttempts 的值又是多少呢?回到最开始,当执行出错会进入 DefaultErrorHandler 。DefaultErrorHandler 默认的构造函数是:
279
0 commit comments