Skip to content

Double micrometer-tracing-bridge since last Spring Cloud Stream #3100

@mfrechePgest

Description

@mfrechePgest

Hey !

Upgrading the last Spring Cloud train ( 2024.0.1 ) don't work out of the box because of dependencies provided by spring-cloud-stream-test-binder

In this version, it provides a micrometer bridge : https://github.com/spring-cloud/spring-cloud-stream/blame/main/core/spring-cloud-stream-test-binder/pom.xml#L33
It was added in this commit : a88c34f

In our code, we already have an otel bridge dependency, and the application now fails to start (in tests at least) because of the 2 implementations of the same beans.

It's pretty simple to reproduce with this pack of dependencies on an empty project :

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-actuator'
	implementation 'io.micrometer:micrometer-tracing-bridge-otel'
	implementation 'org.springframework.cloud:spring-cloud-stream'


	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	testImplementation 'org.springframework.cloud:spring-cloud-stream-test-binder'
	testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

gradle dependencies shows we have 2 micrometer-tracing-bridge in our dependencies (otel & brave).
And a simple test which tries to load the context will fail.

Sample repo if needed

As a workaround, I can exclude dependency :

testImplementation("org.springframework.cloud:spring-cloud-stream-test-binder") {
     exclude group:"io.micrometer", module:"micrometer-tracing-bridge-brave"
}

... but I guess i shouldn't.

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions