Open webtrekk-kane opened 8 years ago
Registering the feature yourself is the right apporach. To configure your application please register com.eclipsesource.jaxrs.publisher.ApplicationConfiguration as a service and provide the properties you want to use.
OK, that is what I am doing right now, but my ApplicationConfiguration is registered via Declarative Services, while the MonitoringFeature is registered with a standard OSGi Activator. In addition, both of these are registered by a Bundle different from the actual JAX-RS resource(s). So, could this be a timing problem for service registration?
In a Karaf 3.x environment with Jolokia feature installed, I want to enable the Jersey MBeans feature to fetch statistics for all my resources.
First, I tried with just exposing an ApplicationConfiguration service using the following configuration:
...according to https://jersey.java.net/documentation/latest/monitoring_tracing.html.
This does not work at all and I figured out, that the default configuration explicitly disables the auto-discoverable features, so I added a
jersey.config.server.disableAutoDiscovery = false
to the configuration without success.In the next step I explicitly registered the MonitoringFeature myself inside an Activator, with the result that I then get the MBeans registered and exposed, but they don't seem to get actually used or updated - which may relate to a race-condition when binding actual resources to features at the time that Jersey configures the resource instance.