Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add camel-quarkus-microprofile-metrics when using camel-quarkus-azure-eventhubs components #2442

Closed
weimeilin79 opened this issue Apr 5, 2021 · 2 comments
Assignees
Milestone

Comments

@weimeilin79
Copy link

Problem

While making a demo, I notice whenever I have the components to Azure, there is a "Multiple producers of item class " error, when I also tried to add metric for observability.

So I took the observability demo in Camel Quarkus Example. Same thing happens.

Error Msg:

[ERROR] Port 5005 in use, not starting in debug mode
2021-04-05 13:06:13,728 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.ChainBuildException: Multiple producers of item class io.quarkus.deployment.metrics.MetricsCapabilityBuildItem (io.quarkus.micrometer.deployment.MicrometerProcessor#metricsCapabilityBuildItem)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:396)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:269)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:66)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:79)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:378)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:56)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:127)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:84)
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:144)
	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)
Caused by: io.quarkus.builder.ChainBuildException: Multiple producers of item class io.quarkus.deployment.metrics.MetricsCapabilityBuildItem (io.quarkus.micrometer.deployment.MicrometerProcessor#metricsCapabilityBuildItem)
	at io.quarkus.builder.BuildStepBuilder.build(BuildStepBuilder.java:195)
	at io.quarkus.builder.BuildStepBuilder.buildIf(BuildStepBuilder.java:206)
	at io.quarkus.deployment.ExtensionLoader.lambda$loadStepsFromClass$110(ExtensionLoader.java:880)
	at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	at io.quarkus.deployment.ExtensionLoader.lambda$loadStepsFromClass$111(ExtensionLoader.java:948)
	at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	......
	at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:104)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:394)
	... 9 more
Caused by: java.lang.Throwable: This is the location of the conflicting producer (io.quarkus.smallrye.metrics.deployment.SmallRyeMetricsProcessor#metricsCapabilityBuildItem)
	at io.quarkus.builder.BuildStepBuilder.build(BuildStepBuilder.java:195)
	at io.quarkus.builder.BuildStepBuilder.buildIf(BuildStepBuilder.java:206)
	at io.quarkus.deployment.ExtensionLoader.lambda$loadStepsFromClass$110(ExtensionLoader.java:880)
	at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	at io.quarkus.deployment.ExtensionLoader.lambda$loadStepsFromClass$111(ExtensionLoader.java:948)
	at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	.....
	at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	at java.base/java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)

Version
Camel Quarkus : 1.8.0

How to reproduce
Use the observability in Camel Quarkus Example repo, [https://github.com/apache/camel-quarkus-examples/tree/master/observability]

Add the azure-eventhubs dependency

<dependency>
      <groupId>org.apache.camel.quarkus</groupId>
      <artifactId>camel-quarkus-azure-eventhubs</artifactId>
    </dependency>

And do the normal quarkus run

mvn clean compile quarkus:dev
@zhfeng
Copy link
Contributor

zhfeng commented Apr 8, 2021

@weimeilin79 It looks like camel-quarkus-azure-eventhubs depends on quarkus-micrometer which produces the MetricsCapabilityBuildItem.

[INFO] ├─ org.apache.camel.quarkus:camel-quarkus-azure-eventhubs-deployment:jar:1.8.1 (compile)
[INFO] │  ├─ org.apache.camel.quarkus:camel-quarkus-azure-storage-blob-deployment:jar:1.8.1 (compile)
[INFO] │  │  ├─ org.apache.camel.quarkus:camel-quarkus-support-azure-core-deployment:jar:1.8.1 (compile)
[INFO] │  │  │  ├─ org.apache.camel.quarkus:camel-quarkus-support-jackson-dataformat-xml-deployment:jar:1.8.1 (compile)
[INFO] │  │  │  │  ├─ io.quarkus:quarkus-jackson-deployment:jar:1.13.0.Final (compile)
[INFO] │  │  │  │  │  ├─ io.quarkus:quarkus-jackson-spi:jar:1.13.0.Final (compile)
[INFO] │  │  │  │  │  └─ io.quarkus:quarkus-jackson:jar:1.13.0.Final (compile)
[INFO] │  │  │  │  │     ├─ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.12.1 (compile)
[INFO] │  │  │  │  │     └─ com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.12.1 (compile)
[INFO] │  │  │  │  ├─ io.quarkus:quarkus-jaxb-deployment:jar:1.13.0.Final (compile)
[INFO] │  │  │  │  │  ├─ io.quarkus:quarkus-jaxp-deployment:jar:1.13.0.Final (compile)
[INFO] │  │  │  │  │  │  └─ io.quarkus:quarkus-jaxp:jar:1.13.0.Final (compile)
[INFO] │  │  │  │  │  └─ io.quarkus:quarkus-jaxb:jar:1.13.0.Final (compile)
[INFO] │  │  │  │  └─ org.apache.camel.quarkus:camel-quarkus-support-jackson-dataformat-xml:jar:1.8.1 (compile)
[INFO] │  │  │  │     └─ com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.12.1 (compile)
[INFO] │  │  │  │        ├─ com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.12.1 (compile)
[INFO] │  │  │  │        ├─ org.codehaus.woodstox:stax2-api:jar:4.2 (compile)
[INFO] │  │  │  │        └─ com.fasterxml.woodstox:woodstox-core:jar:6.1.1 (compile)
[INFO] │  │  │  ├─ org.apache.camel.quarkus:camel-quarkus-support-reactor-netty-deployment:jar:1.8.1 (compile)
[INFO] │  │  │  │  ├─ io.quarkus:quarkus-micrometer-deployment:jar:1.13.0.Final (compile)

So I think a simpe work around could be to exclude quarkus-micrometer just like

+       <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-azure-eventhubs</artifactId>
+            <exclusions>
+                   <exclusion>
+                           <groupId>io.quarkus</groupId>
+                           <artifactId>quarkus-micrometer-deployment</artifactId>
+                   </exclusion>
+           </exclusions>
+        </dependency>

But we still need to investigate why quarkus-micrometer has been included in camel-support-reactor-netty.

@jamesnetherton jamesnetherton self-assigned this Apr 12, 2021
jamesnetherton added a commit to jamesnetherton/camel-quarkus that referenced this issue Apr 12, 2021
@jamesnetherton
Copy link
Contributor

PR to fix this is here #2462.

The other workaround would be to use camel-quarkus-micrometer instead of camel-quarkus-microprofile-metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants