Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import com.solace.spring.cloud.stream.binder.meter.SolaceMessageMeterBinder;
import com.solace.spring.cloud.stream.binder.meter.SolaceMeterAccessor;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(MeterRegistry.class)
@ConditionalOnBean(MeterRegistry.class)
Comment on lines 15 to +16

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this PR!

Looks like a test is failing though. Can you try changing the annotations (lines 10-11) to this?

@AutoConfiguration(after = { MetricsAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class })
@ConditionalOnClass(MeterRegistry.class)
@ConditionalOnBean(MeterRegistry.class)

This is the pattern used in a lot of meter autoconfiguration classes such as https://github.com/spring-projects/spring-boot/blob/v4.1.0/module/spring-boot-micrometer-metrics/src/main/java/org/springframework/boot/micrometer/metrics/autoconfigure/jvm/JvmMetricsAutoConfiguration.java#L59-L61

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.
Using no IDE, hope this works 🤞

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this was failing; I guess that won't go away by the changes.

2026-07-13T16:37:44.0227979Z [ERROR] Failures: 
2026-07-13T16:37:44.0228788Z [ERROR]   MultiBinderIT.lambda$checkSolaceMetricsAreExposed$2:97 Multiple Exceptions (2):
2026-07-13T16:37:44.0229846Z JSON path "names"
2026-07-13T16:37:44.0230296Z Expected: a collection containing "solace.message.size.payload"
2026-07-13T16:37:44.0242505Z      but: mismatches were: [was "application.ready.time", was "application.started.time", was "disk.free", was "disk.total"
, was "executor.active", was "executor.completed", was "executor.pool.core", was "executor.pool.max", was "executor.pool.size", was "executor.queue.rema
ining", was "executor.queued", was "http.server.requests.active", was "jvm.buffer.count", was "jvm.buffer.memory.used", was "jvm.buffer.total.capacity",
 was "jvm.classes.loaded", was "jvm.classes.loaded.count", was "jvm.classes.unloaded", was "jvm.compilation.time", was "jvm.gc.live.data.size", was "jvm
.gc.max.data.size", was "jvm.gc.memory.allocated", was "jvm.gc.memory.promoted", was "jvm.gc.overhead", was "jvm.gc.pause", was "jvm.info", was "jvm.mem
ory.committed", was "jvm.memory.max", was "jvm.memory.usage.after.gc", was "jvm.memory.used", was "jvm.threads.daemon", was "jvm.threads.live", was "jvm
.threads.peak", was "jvm.threads.started", was "jvm.threads.states", was "logback.events", was "process.cpu.time", was "process.cpu.usage", was "process
.files.max", was "process.files.open", was "process.start.time", was "process.uptime", was "spring.cloud.function", was "spring.cloud.function.active", 
was "spring.integration.channels", was "spring.integration.handlers", was "spring.integration.send", was "spring.integration.sources", was "spring.secur
ity.authorizations", was "spring.security.authorizations.active", was "spring.security.filterchains", was "spring.security.filterchains.access.exception
s.before", was "spring.security.filterchains.active", was "spring.security.filterchains.authentication.anonymous.before", was "spring.security.filtercha
ins.authorization.before", was "spring.security.filterchains.context.async.before", was "spring.security.filterchains.context.holder.before", was "sprin
g.security.filterchains.context.servlet.before", was "spring.security.filterchains.csrf.before", was "spring.security.filterchains.header.before", was "
spring.security.filterchains.logout.before", was "spring.security.filterchains.requestcache.before", was "spring.security.filterchains.session.urlencodi
ng.before", was "spring.security.http.secured.requests.active", was "system.cpu.count", was "system.cpu.usage", was "system.load.average.1m"]
2026-07-13T16:37:44.0256052Z JSON path "names"
2026-07-13T16:37:44.0256575Z Expected: a collection containing "solace.message.size.total"
2026-07-13T16:37:44.0269168Z      but: mismatches were: [was "application.ready.time", was "application.started.time", was "disk.free", was "disk.total"
, was "executor.active", was "executor.completed", was "executor.pool.core", was "executor.pool.max", was "executor.pool.size", was "executor.queue.rema
ining", was "executor.queued", was "http.server.requests.active", was "jvm.buffer.count", was "jvm.buffer.memory.used", was "jvm.buffer.total.capacity",
 was "jvm.classes.loaded", was "jvm.classes.loaded.count", was "jvm.classes.unloaded", was "jvm.compilation.time", was "jvm.gc.live.data.size", was "jvm
.gc.max.data.size", was "jvm.gc.memory.allocated", was "jvm.gc.memory.promoted", was "jvm.gc.overhead", was "jvm.gc.pause", was "jvm.info", was "jvm.mem
ory.committed", was "jvm.memory.max", was "jvm.memory.usage.after.gc", was "jvm.memory.used", was "jvm.threads.daemon", was "jvm.threads.live", was "jvm
.threads.peak", was "jvm.threads.started", was "jvm.threads.states", was "logback.events", was "process.cpu.time", was "process.cpu.usage", was "process
.files.max", was "process.files.open", was "process.start.time", was "process.uptime", was "spring.cloud.function", was "spring.cloud.function.active", was "spring.integration.channels", was "spring.integration.handlers", was "spring.integration.send", was "spring.integration.sources", was "spring.security.authorizations", was "spring.security.authorizations.active", was "spring.security.filterchains", was "spring.security.filterchains.access.exceptions.before", was "spring.security.filterchains.active", was "spring.security.filterchains.authentication.anonymous.before", was "spring.security.filterchains.authorization.before", was "spring.security.filterchains.context.async.before", was "spring.security.filterchains.context.holder.before", was "spring.security.filterchains.context.servlet.before", was "spring.security.filterchains.csrf.before", was "spring.security.filterchains.header.before", was "spring.security.filterchains.logout.before", was "spring.security.filterchains.requestcache.before", was "spring.security.filterchains.session.urlencoding.before", was "spring.security.http.secured.requests.active", was "system.cpu.count", was "system.cpu.usage", was "system.load.average.1m"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try removing @Configuration(proxyBeanMethods = false)? I think it might be conflicting with @AutoConfiguration

public final class SolaceMeterConfiguration {
@Bean
SolaceMessageMeterBinder solaceMessageMeterBinder() {
Expand Down
Loading