Commit e813218
Fixes: #2943
The `if (this.kafkaAdmin != null && this.clusterId == null) {` condition
might be always true for concurrent threads (especially virtual).
Therefore, all of those threads are calling `this.kafkaAdmin.clusterId()`
making unnecessary network chats to Kafka broker
* Surround `this.kafkaAdmin.clusterId()` call with `Lock`
**Cherry-pick to `3.0.x`**
1 parent 654c531 commit e813218
File tree
1 file changed
+13
-1
lines changed- spring-kafka/src/main/java/org/springframework/kafka/core
1 file changed
+13
-1
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
500 | 504 | | |
501 | 505 | | |
502 | 506 | | |
503 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
504 | 516 | | |
505 | 517 | | |
506 | 518 | | |
| |||
0 commit comments