Re: RESTful web service in Karaf using CXF and blueprint
If the services that you're looking to provide use JAX-RS the there is a specification proposal for OSGi R7 that you should look at. Prototyping work is starting in Apache Aries now. Tim Sent from my iPhone > On 15 Aug 2016, at 18:56, Scott Lewis <sle...@composent.com> wrote: > >> On 8/15/2016 10:28 AM, Christian Schneider wrote: >> >> >> ECF also supports CXF now but I am not sure at what level of CXF features. > > This provider [1], will support all of the jax-rs Configurable/Configuration > capabilities that CXF supports. It will also be possible to extend [1] to > create a custom provider, which are of course free use any of CXF's APIs. > Same with Jersey. > > Scott > > [1] > https://github.com/ECF/JaxRSProviders/tree/master/bundles/org.eclipse.ecf.provider.cxf.server > >> >> Christian >> >> 2016-08-15 17:21 GMT+02:00 Marc Durand <marc.dur...@gmail.com>: >>> Hello, >>> I was following Christian's tutorial here: >>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi >>> >>> And I also found come blog posts from JB that show how to deploy RESTful >>> services using blueprint. >>> >>> What I couldn't find was an example on how to deploy a RESTful service where >>> the resource class is an OSGi service (to take advantage of SCR references >>> to other services in the resource class). I was able to do it by using a >>> element instead of a element in the blueprint file. Is >>> this approach correct or will it lead to other problems down the road? >>> >>> Thanks! >>> Marc >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html >>> Sent from the Karaf - User mailing list archive at Nabble.com. >> >> >> >> -- >> -- >> Christian Schneider >> http://www.liquid-reality.de >> >> Open Source Architect >> http://www.talend.com >
Re: RESTful web service in Karaf using CXF and blueprint
On 8/15/2016 10:28 AM, Christian Schneider wrote: ECF also supports CXF now but I am not sure at what level of CXF features. This provider [1], will support all of the jax-rs Configurable/Configuration capabilities that CXF supports. It will also be possible to extend [1] to create a custom provider, which are of course free use any of CXF's APIs. Same with Jersey. Scott [1] https://github.com/ECF/JaxRSProviders/tree/master/bundles/org.eclipse.ecf.provider.cxf.server Christian 2016-08-15 17:21 GMT+02:00 Marc Durand <marc.dur...@gmail.com <mailto:marc.dur...@gmail.com>>: Hello, I was following Christian's tutorial here: http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi <http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi> And I also found come blog posts from JB that show how to deploy RESTful services using blueprint. What I couldn't find was an example on how to deploy a RESTful service where the resource class is an OSGi service (to take advantage of SCR references to other services in the resource class). I was able to do it by using a element instead of a element in the blueprint file. Is this approach correct or will it lead to other problems down the road? Thanks! Marc -- View this message in context: http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html <http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html> Sent from the Karaf - User mailing list archive at Nabble.com. -- -- Christian Schneider http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46=http%3a%2f%2fwww.liquid-reality.de> Open Source Architect http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46=http%3a%2f%2fwww.talend.com>
Re: RESTful web service in Karaf using CXF and blueprint
Christian, you might recall that I got into problems with configuration issues, and you plan to address the issues I ran into in 2.0. I can dig that mail up again if you don't still have it. Thus 'not ready yet.' On Mon, Aug 15, 2016 at 1:30 PM, Christian Schneider <ch...@die-schneider.net> wrote: > Hi Benson, > > would be great to get some feedback about your experiences using dOSGi. As > we are approaching the 2.0 version now is the best time to get important > features in. > > Christian > > 2016-08-15 19:24 GMT+02:00 Benson Margulies <ben...@basistech.com>: >> >> Correct. I tried the dOSGi stuff, and it wasn't really ready to do >> what I needed to do. >> >> On Mon, Aug 15, 2016 at 1:17 PM, David Jencks <david.a.jen...@gmail.com> >> wrote: >> > Just to see if I understand what you are doing, this approach does not >> > involve the osgi service registry in any way for the REST service >> > implementation object? You are directly registering the component instance >> > with CXF, and there is no need for it to expose any service interfaces at >> > all? >> > >> > thanks >> > david jencks >> > >> >> On Aug 15, 2016, at 10:10 AM, Benson Margulies <ben...@basistech.com> >> >> wrote: >> >> >> >> I do this by making DS @Activate methods call the CXF API to publish >> >> REST services. >> >> >> >> >> >> On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sle...@composent.com> >> >> wrote: >> >>> Hi Marc, >> >>> >> >>> The OSGi Remote Services specification (and the associated Remote >> >>> Service >> >>> Admin sepc) defines a standardized way to export OSGi services for >> >>> remote >> >>> access. The specification is defined in a way that allows the use of >> >>> arbitrary distribution providers that are responsible for making the >> >>> OSGi >> >>> service accessible from outside of the OSGi process. >> >>> >> >>> ECF [1] has an implementation of these specs that supports many >> >>> distribution >> >>> providers [2], including two that I'm working on now that supports any >> >>> Jax-RS implementation (i.e. both CXF and Jersey). These two >> >>> distribution >> >>> providers are here [3] and I'm finalizing them for an initial release. >> >>> Note that for these providers, in addition to specifying jax-rs >> >>> resources >> >>> via OSGi services, the jax-rs configuration (e.g. >> >>> MessageBodyReader/Writers, >> >>> Features, etc) can also be specified via OSGi services. >> >>> >> >>> Scott >> >>> >> >>> [1] https://wiki.eclipse.org/ECF >> >>> [2] https://wiki.eclipse.org/Distribution_Providers >> >>> [3] https://github.com/ECF/JaxRSProviders >> >>> >> >>> On 8/15/2016 8:21 AM, Marc Durand wrote: >> >>>> >> >>>> Hello, >> >>>> I was following Christian's tutorial here: >> >>>> >> >>>> >> >>>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi >> >>>> >> >>>> And I also found come blog posts from JB that show how to deploy >> >>>> RESTful >> >>>> services using blueprint. >> >>>> >> >>>> What I couldn't find was an example on how to deploy a RESTful >> >>>> service >> >>>> where >> >>>> the resource class is an OSGi service (to take advantage of SCR >> >>>> references >> >>>> to other services in the resource class). I was able to do it by >> >>>> using a >> >>>> element instead of a element in the blueprint >> >>>> file. Is >> >>>> this approach correct or will it lead to other problems down the >> >>>> road? >> >>>> >> >>>> Thanks! >> >>>> Marc >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> -- >> >>>> View this message in context: >> >>>> >> >>>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html >> >>>> Sent from the Karaf - User mailing list archive at Nabble.com. >> >>> >> >>> >> >>> >> > > > > > > -- > -- > Christian Schneider > http://www.liquid-reality.de > > Open Source Architect > http://www.talend.com
Re: RESTful web service in Karaf using CXF and blueprint
Hi Benson, would be great to get some feedback about your experiences using dOSGi. As we are approaching the 2.0 version now is the best time to get important features in. Christian 2016-08-15 19:24 GMT+02:00 Benson Margulies <ben...@basistech.com>: > Correct. I tried the dOSGi stuff, and it wasn't really ready to do > what I needed to do. > > On Mon, Aug 15, 2016 at 1:17 PM, David Jencks <david.a.jen...@gmail.com> > wrote: > > Just to see if I understand what you are doing, this approach does not > involve the osgi service registry in any way for the REST service > implementation object? You are directly registering the component instance > with CXF, and there is no need for it to expose any service interfaces at > all? > > > > thanks > > david jencks > > > >> On Aug 15, 2016, at 10:10 AM, Benson Margulies <ben...@basistech.com> > wrote: > >> > >> I do this by making DS @Activate methods call the CXF API to publish > >> REST services. > >> > >> > >> On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sle...@composent.com> > wrote: > >>> Hi Marc, > >>> > >>> The OSGi Remote Services specification (and the associated Remote > Service > >>> Admin sepc) defines a standardized way to export OSGi services for > remote > >>> access. The specification is defined in a way that allows the use of > >>> arbitrary distribution providers that are responsible for making the > OSGi > >>> service accessible from outside of the OSGi process. > >>> > >>> ECF [1] has an implementation of these specs that supports many > distribution > >>> providers [2], including two that I'm working on now that supports any > >>> Jax-RS implementation (i.e. both CXF and Jersey). These two > distribution > >>> providers are here [3] and I'm finalizing them for an initial release. > >>> Note that for these providers, in addition to specifying jax-rs > resources > >>> via OSGi services, the jax-rs configuration (e.g. > MessageBodyReader/Writers, > >>> Features, etc) can also be specified via OSGi services. > >>> > >>> Scott > >>> > >>> [1] https://wiki.eclipse.org/ECF > >>> [2] https://wiki.eclipse.org/Distribution_Providers > >>> [3] https://github.com/ECF/JaxRSProviders > >>> > >>> On 8/15/2016 8:21 AM, Marc Durand wrote: > >>>> > >>>> Hello, > >>>> I was following Christian's tutorial here: > >>>> > >>>> http://liquid-reality.de/display/liquid/2011/12/22/ > Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi > >>>> > >>>> And I also found come blog posts from JB that show how to deploy > RESTful > >>>> services using blueprint. > >>>> > >>>> What I couldn't find was an example on how to deploy a RESTful service > >>>> where > >>>> the resource class is an OSGi service (to take advantage of SCR > references > >>>> to other services in the resource class). I was able to do it by > using a > >>>> element instead of a element in the blueprint > file. Is > >>>> this approach correct or will it lead to other problems down the road? > >>>> > >>>> Thanks! > >>>> Marc > >>>> > >>>> > >>>> > >>>> > >>>> -- > >>>> View this message in context: > >>>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in- > Karaf-using-CXF-and-blueprint-tp4047529.html > >>>> Sent from the Karaf - User mailing list archive at Nabble.com. > >>> > >>> > >>> > > > -- -- Christian Schneider http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46=http%3a%2f%2fwww.liquid-reality.de> Open Source Architect http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46=http%3a%2f%2fwww.talend.com>
Re: RESTful web service in Karaf using CXF and blueprint
The tutorial uses blueprint to publish the service and uses the CXF namespace for blueprint. This is currently the most flexible approach as it supports all features of CXF. It is limited to blueprint though. If you want to use DS to annotate your service and do injections then like Scott described Remote Service Admin is the better choice as DS is not directly supported by CXF. If you want to expose SOAP and REST services then CXF DOSGi provides a quite complete support for the CXF features. The upcoming version 2.0 of CXF DOSGi will be slimmer in footprint and support even more CXF features so it will be almost en par with CXF blueprint. It allows to define almost all CXF settings using intents (Databinding, binding, SSL, security, Rest providers, Logging, CXF features, http conduits). ECF also supports CXF now but I am not sure at what level of CXF features. Christian 2016-08-15 17:21 GMT+02:00 Marc Durand <marc.dur...@gmail.com>: > Hello, > I was following Christian's tutorial here: > http://liquid-reality.de/display/liquid/2011/12/22/ > Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi > > And I also found come blog posts from JB that show how to deploy RESTful > services using blueprint. > > What I couldn't find was an example on how to deploy a RESTful service > where > the resource class is an OSGi service (to take advantage of SCR references > to other services in the resource class). I was able to do it by using a > element instead of a element in the blueprint file. Is > this approach correct or will it lead to other problems down the road? > > Thanks! > Marc > > > > > -- > View this message in context: http://karaf.922171.n3.nabble. > com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html > Sent from the Karaf - User mailing list archive at Nabble.com. > -- -- Christian Schneider http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46=http%3a%2f%2fwww.liquid-reality.de> Open Source Architect http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46=http%3a%2f%2fwww.talend.com>
Re: RESTful web service in Karaf using CXF and blueprint
Correct. I tried the dOSGi stuff, and it wasn't really ready to do what I needed to do. On Mon, Aug 15, 2016 at 1:17 PM, David Jencks <david.a.jen...@gmail.com> wrote: > Just to see if I understand what you are doing, this approach does not > involve the osgi service registry in any way for the REST service > implementation object? You are directly registering the component instance > with CXF, and there is no need for it to expose any service interfaces at all? > > thanks > david jencks > >> On Aug 15, 2016, at 10:10 AM, Benson Margulies <ben...@basistech.com> wrote: >> >> I do this by making DS @Activate methods call the CXF API to publish >> REST services. >> >> >> On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sle...@composent.com> wrote: >>> Hi Marc, >>> >>> The OSGi Remote Services specification (and the associated Remote Service >>> Admin sepc) defines a standardized way to export OSGi services for remote >>> access. The specification is defined in a way that allows the use of >>> arbitrary distribution providers that are responsible for making the OSGi >>> service accessible from outside of the OSGi process. >>> >>> ECF [1] has an implementation of these specs that supports many distribution >>> providers [2], including two that I'm working on now that supports any >>> Jax-RS implementation (i.e. both CXF and Jersey). These two distribution >>> providers are here [3] and I'm finalizing them for an initial release. >>> Note that for these providers, in addition to specifying jax-rs resources >>> via OSGi services, the jax-rs configuration (e.g. MessageBodyReader/Writers, >>> Features, etc) can also be specified via OSGi services. >>> >>> Scott >>> >>> [1] https://wiki.eclipse.org/ECF >>> [2] https://wiki.eclipse.org/Distribution_Providers >>> [3] https://github.com/ECF/JaxRSProviders >>> >>> On 8/15/2016 8:21 AM, Marc Durand wrote: >>>> >>>> Hello, >>>> I was following Christian's tutorial here: >>>> >>>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi >>>> >>>> And I also found come blog posts from JB that show how to deploy RESTful >>>> services using blueprint. >>>> >>>> What I couldn't find was an example on how to deploy a RESTful service >>>> where >>>> the resource class is an OSGi service (to take advantage of SCR references >>>> to other services in the resource class). I was able to do it by using a >>>> element instead of a element in the blueprint file. Is >>>> this approach correct or will it lead to other problems down the road? >>>> >>>> Thanks! >>>> Marc >>>> >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html >>>> Sent from the Karaf - User mailing list archive at Nabble.com. >>> >>> >>> >
Re: RESTful web service in Karaf using CXF and blueprint
Just to see if I understand what you are doing, this approach does not involve the osgi service registry in any way for the REST service implementation object? You are directly registering the component instance with CXF, and there is no need for it to expose any service interfaces at all? thanks david jencks > On Aug 15, 2016, at 10:10 AM, Benson Margulies <ben...@basistech.com> wrote: > > I do this by making DS @Activate methods call the CXF API to publish > REST services. > > > On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sle...@composent.com> wrote: >> Hi Marc, >> >> The OSGi Remote Services specification (and the associated Remote Service >> Admin sepc) defines a standardized way to export OSGi services for remote >> access. The specification is defined in a way that allows the use of >> arbitrary distribution providers that are responsible for making the OSGi >> service accessible from outside of the OSGi process. >> >> ECF [1] has an implementation of these specs that supports many distribution >> providers [2], including two that I'm working on now that supports any >> Jax-RS implementation (i.e. both CXF and Jersey). These two distribution >> providers are here [3] and I'm finalizing them for an initial release. >> Note that for these providers, in addition to specifying jax-rs resources >> via OSGi services, the jax-rs configuration (e.g. MessageBodyReader/Writers, >> Features, etc) can also be specified via OSGi services. >> >> Scott >> >> [1] https://wiki.eclipse.org/ECF >> [2] https://wiki.eclipse.org/Distribution_Providers >> [3] https://github.com/ECF/JaxRSProviders >> >> On 8/15/2016 8:21 AM, Marc Durand wrote: >>> >>> Hello, >>> I was following Christian's tutorial here: >>> >>> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi >>> >>> And I also found come blog posts from JB that show how to deploy RESTful >>> services using blueprint. >>> >>> What I couldn't find was an example on how to deploy a RESTful service >>> where >>> the resource class is an OSGi service (to take advantage of SCR references >>> to other services in the resource class). I was able to do it by using a >>> element instead of a element in the blueprint file. Is >>> this approach correct or will it lead to other problems down the road? >>> >>> Thanks! >>> Marc >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html >>> Sent from the Karaf - User mailing list archive at Nabble.com. >> >> >>
Re: RESTful web service in Karaf using CXF and blueprint
I do this by making DS @Activate methods call the CXF API to publish REST services. On Mon, Aug 15, 2016 at 1:08 PM, Scott Lewis <sle...@composent.com> wrote: > Hi Marc, > > The OSGi Remote Services specification (and the associated Remote Service > Admin sepc) defines a standardized way to export OSGi services for remote > access. The specification is defined in a way that allows the use of > arbitrary distribution providers that are responsible for making the OSGi > service accessible from outside of the OSGi process. > > ECF [1] has an implementation of these specs that supports many distribution > providers [2], including two that I'm working on now that supports any > Jax-RS implementation (i.e. both CXF and Jersey). These two distribution > providers are here [3] and I'm finalizing them for an initial release. > Note that for these providers, in addition to specifying jax-rs resources > via OSGi services, the jax-rs configuration (e.g. MessageBodyReader/Writers, > Features, etc) can also be specified via OSGi services. > > Scott > > [1] https://wiki.eclipse.org/ECF > [2] https://wiki.eclipse.org/Distribution_Providers > [3] https://github.com/ECF/JaxRSProviders > > On 8/15/2016 8:21 AM, Marc Durand wrote: >> >> Hello, >> I was following Christian's tutorial here: >> >> http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi >> >> And I also found come blog posts from JB that show how to deploy RESTful >> services using blueprint. >> >> What I couldn't find was an example on how to deploy a RESTful service >> where >> the resource class is an OSGi service (to take advantage of SCR references >> to other services in the resource class). I was able to do it by using a >> element instead of a element in the blueprint file. Is >> this approach correct or will it lead to other problems down the road? >> >> Thanks! >> Marc >> >> >> >> >> -- >> View this message in context: >> http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html >> Sent from the Karaf - User mailing list archive at Nabble.com. > > >
Re: RESTful web service in Karaf using CXF and blueprint
Hi Marc, The OSGi Remote Services specification (and the associated Remote Service Admin sepc) defines a standardized way to export OSGi services for remote access. The specification is defined in a way that allows the use of arbitrary distribution providers that are responsible for making the OSGi service accessible from outside of the OSGi process. ECF [1] has an implementation of these specs that supports many distribution providers [2], including two that I'm working on now that supports any Jax-RS implementation (i.e. both CXF and Jersey). These two distribution providers are here [3] and I'm finalizing them for an initial release. Note that for these providers, in addition to specifying jax-rs resources via OSGi services, the jax-rs configuration (e.g. MessageBodyReader/Writers, Features, etc) can also be specified via OSGi services. Scott [1] https://wiki.eclipse.org/ECF [2] https://wiki.eclipse.org/Distribution_Providers [3] https://github.com/ECF/JaxRSProviders On 8/15/2016 8:21 AM, Marc Durand wrote: Hello, I was following Christian's tutorial here: http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi And I also found come blog posts from JB that show how to deploy RESTful services using blueprint. What I couldn't find was an example on how to deploy a RESTful service where the resource class is an OSGi service (to take advantage of SCR references to other services in the resource class). I was able to do it by using a element instead of a element in the blueprint file. Is this approach correct or will it lead to other problems down the road? Thanks! Marc -- View this message in context: http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html Sent from the Karaf - User mailing list archive at Nabble.com.
RESTful web service in Karaf using CXF and blueprint
Hello, I was following Christian's tutorial here: http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi And I also found come blog posts from JB that show how to deploy RESTful services using blueprint. What I couldn't find was an example on how to deploy a RESTful service where the resource class is an OSGi service (to take advantage of SCR references to other services in the resource class). I was able to do it by using a element instead of a element in the blueprint file. Is this approach correct or will it lead to other problems down the road? Thanks! Marc -- View this message in context: http://karaf.922171.n3.nabble.com/RESTful-web-service-in-Karaf-using-CXF-and-blueprint-tp4047529.html Sent from the Karaf - User mailing list archive at Nabble.com.