Skip to content

Commit 21fcb11

Browse files
garyrussellartembilan
authored andcommitted
KBGH-356: Fix thread naming with no bean name
See spring-attic/spring-cloud-stream-binder-kafka#356 Use token 'consumer' for thread prefix when no bean name. **cherry-pick to 2.0.x, 1.3.x** (cherry picked from commit fd69447)
1 parent 23e97a5 commit 21fcb11

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: spring-kafka/src/main/java/org/springframework/kafka/listener/ConcurrentMessageListenerContainer.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ protected void doStart() {
130130
container = new KafkaMessageListenerContainer<>(this.consumerFactory, containerProperties,
131131
partitionSubset(containerProperties, i));
132132
}
133-
if (getBeanName() != null) {
134-
container.setBeanName(getBeanName() + "-" + i);
135-
}
133+
String beanName = getBeanName();
134+
container.setBeanName((beanName != null ? beanName : "consumer") + "-" + i);
136135
if (getApplicationEventPublisher() != null) {
137136
container.setApplicationEventPublisher(getApplicationEventPublisher());
138137
}

0 commit comments

Comments
 (0)