-
Notifications
You must be signed in to change notification settings - Fork 5
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
vertx-dropwizard-metrics module isn't osgi ready #178
Comments
Hi @ANierbeck The main reason why the OSGi metadata is not present in this bundle is because it's a bit more complex than just adding the metadata. Computing the metadata is simple, however using the resulting bundle is a bit more complex. This is because the Is it impossible to use ? No, but it would require some classloader magic to find the SPI file and load the Here is a Gist showing how you can do that: I think we can add the OSGi metadata and people wanting to use this metrics implementation can refer to the gist. |
I've also tried (successfully) another approach using https://gist.github.com/cescoffier/e8aec18cc86581923f1cc639c2a71c4d It contains a |
Ahh the last one is definitely more appealing. Though have you considered to use Apache Aries SPI-Fly, that should do the trick you did already ... haven't had the time to try it myself yet. |
I never used SPI-Fly, but it is probably very similar (aren't they exposing services ?). Ideally, Vert.x SPI (factories) should be exposed as services, and so the bundle creating the Vert.x instance can pick (Select, react to absence) the services it needs. It would be a static link with these services as it is not possible to change on the fly the metrics factory or cluster manager. My second attempt has 2 purposes:
|
I will give SPI Fly a try later (not sure when ;) ). It'll expose the SPI as service, therefore yes that might be a good way of re-using it. I'll keep you posted, but thanks for creating the metadata already that should help already in just "starting" the bundle :) |
It works quite well with SPI-Fly: maybe for the command too ... but I didn't need that one yet. |
added a pull request for those settings: |
Here's an example on how to use with SPI-Fly (or any other implementation of that osgi-service) in case of pull-request 45 is merged: |
Opposed to the other jars of the vertx project this module isn't generated with dependency headers, therefore it's not possible to use vertx with metrics and jmx enabled.
The text was updated successfully, but these errors were encountered: