Skip to content

Commit fd69447

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**
1 parent f715bbe commit fd69447

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
@@ -153,9 +153,8 @@ protected void doStart() {
153153
container = new KafkaMessageListenerContainer<>(this, this.consumerFactory,
154154
containerProperties, partitionSubset(containerProperties, i));
155155
}
156-
if (getBeanName() != null) {
157-
container.setBeanName(getBeanName() + "-" + i);
158-
}
156+
String beanName = getBeanName();
157+
container.setBeanName((beanName != null ? beanName : "consumer") + "-" + i);
159158
if (getApplicationEventPublisher() != null) {
160159
container.setApplicationEventPublisher(getApplicationEventPublisher());
161160
}

0 commit comments

Comments
 (0)