GH-1214: Fix NPE When no Container id or Bean name
Resolves https://github.com/spring-projects/spring-amqp/issues/1214 Micrometer throws an NPE.
This commit is contained in:
@@ -1144,7 +1144,11 @@ public abstract class AbstractMessageListenerContainer extends RabbitAccessor
|
||||
try {
|
||||
if (this.micrometerHolder == null && MICROMETER_PRESENT && this.micrometerEnabled
|
||||
&& this.applicationContext != null) {
|
||||
this.micrometerHolder = new MicrometerHolder(this.applicationContext, getListenerId(),
|
||||
String id = getListenerId();
|
||||
if (id == null) {
|
||||
id = "no_id_or_beanName";
|
||||
}
|
||||
this.micrometerHolder = new MicrometerHolder(this.applicationContext, id,
|
||||
this.micrometerTags);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user