> Is aries-jax-rs-whiteboard compatible with karaf does any one know? Or does > it depend on things that aren't provided, or rely on other things from later > OSGi specs that it doesn't support? I'm finding I'm having to add in a bunch > of bundles, and I'm wondering whether ultimately it's a dead end?
The Aries JAX-RS Whiteboard implementation builds on top of the OSGi Http Whiteboard spec. Assuming that Karaf’s HTTP whiteboard is compliant with the HTTP whiteboard spec (1.0 would be sufficient) then it should be fine. If Karaf’s HTTP whiteboard isn’t compliant then you could look at putting Felix Http Jetty into Karaf, but that might be pulling at the beginning of a very long thread… You should then be able to get away with relatively few bundles. The JAX-RS Whiteboard API, OSGi Promises + function, the Aries wrapping of the JAX-RS API and the Aries JAX-RS Whiteboard implementation should be enough. This is by far preferable to using CXF directly, where you don’t have proper resource isolation, nor do you have a nice way to apply extensions (e.g. JSON support, CORS headers, etc). Best Regards, Tim > On 22 Nov 2018, at 15:43, [email protected] wrote: > > For largely historical reasons we have ended up with a setup where we use the > standard karaf HTTP whiteboard service, and then run jersey on top of that > with our own homebrew whiteboard service to register JAXRS endpoints. > > I'm looking to replace this with a better solution, presumably based around > the OSGi JAXRS whiteboard spec. and aries-jax-rs-whiteboard > (https://github.com/apache/aries-jax-rs-whiteboard) since that now exists, > which it didn't when we started out. > > Is aries-jax-rs-whiteboard compatible with karaf does any one know? Or does > it depend on things that aren't provided, or rely on other things from later > OSGi specs that it doesn't support? I'm finding I'm having to add in a bunch > of bundles, and I'm wondering whether ultimately it's a dead end? > > Am I better off doing it another way? Karaf comes with CXF doesn't it? My > preference is to use the official OSGi whiteboard, but if that's going to be > too hard right now I'm not against doing it a CXF specific way. The only > example I can find so far though looks something like this: > > @Component(service=TaskServiceRest.class, > property={"service.exported.interfaces=*", > > "service.exported.configs=org.apache.cxf.rs", > > "org.apache.cxf.rs.address=/tasklistRest"}) > > Which seems, well, more complex that necessary in comparison to > @Component(service=TaskServiceRest.class) > @JaxrsResource > > > What's the "best" route right now? It has to be declarative services based, > and whiteboard pattern. > > Thanks.
