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

amqp-client-5.19.0 has a required OSGi dependency on micrometer #1140

Closed
rovarga opened this issue Oct 23, 2023 · 3 comments
Closed

amqp-client-5.19.0 has a required OSGi dependency on micrometer #1140

rovarga opened this issue Oct 23, 2023 · 3 comments
Labels
Milestone

Comments

@rovarga
Copy link

rovarga commented Oct 23, 2023

Describe the bug

amqp-client-5.18.0's Import-Package has only:

io.micrometer.core.instrument;version="[1.11,2)";resolution:=optional

which is satisfied by an optional dependency in pom.xml

amqp-client-5.19.0's Import-Package has also:

io.micrometer.common;version="[1.11,2)";resolution:=optional,
io.micrometer.common.docs;version="[1.11,2)";resolution:=optional,
io.micrometer.common.util;version="[1.11,2)";resolution:=optional,
io.micrometer.core.instrument;version="[1.11,2)",
io.micrometer.observation;version="[1.11,2)",
io.micrometer.observation.docs;version="[1.11,2)";resolution:=optional,
io.micrometer.observation.transport;version="[1.11,2)";resolution:=optional

This leads to failure to resolve the bundle if micrometer is not present

Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve com.rabbitmq.client/5.19.0: missing requirement [com.rabbitmq.client/5.19.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=io.micrometer.core.instrument)(version>=1.11.0)(!(version>=2.0.0)))"
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[?:?]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[?:?]
	... 12 more

Observed transitively through metrics-graphite upgrade from 4.2.20 to 4.2.21, which transitively upgrades ampq-client from 5.18.0 to 5.19.0).

Reproduction steps

  1. Attempt to deploy amqp-client into an OSGi container without also deploying micrometer

Expected behavior

Micrometer remains optional, or the pom.xml dependency on on micrometer-core is not optional=true.

Additional context

Logs from a Karaf validation run: https://s3-logs.opendaylight.org/logs/releng/vex-yul-odl-jenkins-1/controller-maven-verify-7.0.x-mvn38-openjdk17/33/features/odl-mdsal-clustering-commons/target/SFT/karaf.log.gz, the feature being tested is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="odl-controller-7.0.11-SNAPSHOT">
    <repository>mvn:org.opendaylight.odlparent/odl-apache-commons-lang3/12.0.9/xml/features</repository>
    <repository>mvn:org.opendaylight.odlparent/odl-dropwizard-metrics/12.0.9/xml/features</repository>
    <repository>mvn:org.opendaylight.odlparent/odl-servlet-api/12.0.9/xml/features</repository>
    <repository>mvn:org.opendaylight.yangtools/odl-yangtools-data/10.0.11/xml/features</repository>
    <repository>mvn:org.opendaylight.yangtools/odl-yangtools-codec/10.0.11/xml/features</repository>
    <repository>mvn:org.opendaylight.controller/odl-controller-akka/7.0.11-SNAPSHOT/xml/features</repository>
    <feature name="odl-mdsal-clustering-commons" description="OpenDaylight :: Controller :: Clustering Commons" version="7.0.11.SNAPSHOT">
        <details>Common Clustering utilities</details>
        <feature version="[12,13)">odl-apache-commons-lang3</feature>
        <feature version="[12,13)">odl-dropwizard-metrics</feature> <!-- contains metrics-core and a few others ... -->
        <feature version="[12,13)">odl-servlet-api</feature>
        <feature version="[10,11)">odl-yangtools-data</feature>
        <feature version="[10,11)">odl-yangtools-codec</feature>
        <feature version="7.0.11.SNAPSHOT" prerequisite="false" dependency="false">odl-controller-akka</feature>
        <bundle>mvn:org.opendaylight.controller/sal-clustering-commons/7.0.11-SNAPSHOT</bundle>
        <bundle>mvn:io.dropwizard.metrics/metrics-graphite/4.2.21</bundle> <!-- pulls in metrics-graphite ... -->
        <bundle>mvn:com.rabbitmq/amqp-client/5.19.0</bundle> <!-- ... which has this discovered dependency and nothing else  -->
        <bundle>mvn:org.lz4/lz4-java/1.8.0</bundle>
        <bundle>mvn:org.opendaylight.controller/sal-akka-raft/7.0.11-SNAPSHOT</bundle>
        <bundle>mvn:org.opendaylight.controller/cds-mgmt-api/7.0.11-SNAPSHOT</bundle>
        <bundle>mvn:org.opendaylight.controller/sal-akka-segmented-journal/7.0.11-SNAPSHOT</bundle>
        <bundle>mvn:org.opendaylight.controller/atomix-storage/7.0.11-SNAPSHOT</bundle>
    </feature>
</features>
@rovarga rovarga added the bug label Oct 23, 2023
@acogoluegnes acogoluegnes added this to the 5.20.0 milestone Oct 24, 2023
acogoluegnes added a commit that referenced this issue Oct 24, 2023
To make sure io.micrometer.core.instrument and
io.micrometer.observation packages are marked as
optional in the OSGi manifest.

Fixes #1140

(cherry picked from commit 8641c9f)
@acogoluegnes
Copy link
Contributor

Thanks for reporting this. Some Micrometer test support dependencies needed to be set explicitly optional in the POM apparently. Can you give a try to the 5.20.0-SNAPSHOT? https://github.com/rabbitmq/rabbitmq-java-client#snapshots

@rovarga
Copy link
Author

rovarga commented Oct 24, 2023

Thanks for reporting this. Some Micrometer test support dependencies needed to be set explicitly optional in the POM apparently. Can you give a try to the 5.20.0-SNAPSHOT? https://github.com/rabbitmq/rabbitmq-java-client#snapshots

Using amqp-client-5.20.0-20231024.100730-12.jar fixes the test failure and I have verified all the imports are optional. Thanks for the quick turnaround!

@acogoluegnes
Copy link
Contributor

Thanks for the feedback, we'll try to release 5.20.0 in the next few days.

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

No branches or pull requests

2 participants