You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Daniel Langevin <da...@shq.gouv.qc.ca> on 2017/11/28 19:16:47 UTC

Rép. : Re: Restconfiguration using Servlet with Camel in OSGI Karaf

Hi,

i use KARAF as OSGI

i deploy camel-servlet


an no error in the log 
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 | Adding features:
camel-servlet/[2.17.7,2.17.7]
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 | Changes to perform:
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 |   Region: root
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 |     Bundles to install:
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 |      
mvn:org.apache.camel/camel-servlet/2.17.7
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 | Installing bundles:
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 |  
mvn:org.apache.camel/camel-servlet/2.17.7
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 | Starting bundles:
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 |  
org.apache.camel.camel-servlet/2.17.7
 FeaturesServiceImpl                 | 8 -
org.apache.karaf.features.core - 4.0.9 | Done.

Daniel





>>> Mark <el...@gmail.com> 2017-11-28 12:46 >>>
If I'm understanding your deployment correctly, you just need to make
sure
the proper camel bundles/features are deployed.  What OSGi container
are
you using and what do your logs say?


On Tue, Nov 28, 2017 at 12:35 PM, Claus Ibsen <cl...@gmail.com>
wrote:

> Sorry for being a bit short on details, but I dont have the osgi
> example at hand here.
>
> On Tue, Nov 28, 2017 at 6:34 PM, Claus Ibsen <cl...@gmail.com>
> wrote:
> > Hi
> >
> > Yeah I think it has been talked before about osgi and rest here or
on
> > stackoverflow. You can configure camel-servlet for osgi with some
> > "magic" osgi http service stuff.
> >
> > On Tue, Nov 28, 2017 at 5:05 PM, Daniel Langevin
> > <da...@shq.gouv.qc.ca> wrote:
> >> Hi,
> >>
> >> i try to implement a Rest service In OSGI Karaf 4.0.9  with Camel
2.17.7
> >> i want to have multiple REST service from more than one bundle
using
> the same port number
> >>
> >> like this.
> >>
> >> A)  file name ABC-REST-0.0.1.XML deployed containg all routes for
the
> system ABC.
> >>
> >> <restConfiguration bindingMode="auto" component="restlet'
port="9101"
> contextPath="/rest/ABC" />
> >> <rest path="/SendMail">
> >>  <get uri="/{abcIdMail}">
> >>       <to pattern="InOut" uri="direct:abcProcMail"/>
> >>  </get>
> >> </rest>
> >> ...
> >>
> >> call the service with http://serverName:9101/rest/ABC/Sendmail/nnn

> >> recevie a 200 OK
> >>
> >>
> >> B) file name XYZ-REST-0.0.1.XML deployed containg all routes for
the
> system XYZ.
> >>
> >> <restConfiguration bindingMode="auto" component="restlet'
port="9102"
> contextPath="/rest/XYZ" />
> >> <rest path="/GetQuote">
> >>  <get uri="/{abcIdQuote}">
> >>       <to pattern="InOut" uri="direct:xyzProcQuote"/>
> >>  </get>
> >> </rest>
> >> ...
> >> call the service with http://serverName:9102/rest/XYZ/getQuote/nnn

> >> receive a 200 OK
> >>
> >> I want to be able to bind all my rest services on the same port
using
> http servlet , like this ( no error on deployement )
> >>
> >> C) file name ABC-REST-0.0.1.XML containg all routes for the system
ABC.
> >>
> >> <restConfiguration bindingMode="auto" component="servlet'
port="8181"
> contextPath="/rest/ABC" />
> >> <rest path="/SendMail">
> >>  <get uri="/{abcIdMail}">
> >>       <to pattern="InOut" uri="direct:abcProcMail"/>
> >>  </get>
> >> </rest>
> >> ...
> >> call the service with http://serverName:8181/rest/XYZ/getQuote/nnn

> >> receive a 404 url not found
> >>
> >>
> >> aD)file name XYZ-REST-0.0.1.XML containg all routes for the system
XYZ.
> >>
> >> <restConfiguration bindingMode="auto" component="servlet'
port="8181"
> contextPath="/rest/XYZ"
/>
> >> <rest path="/GetQuote">
> >>  <get uri="/{abcIdQuotel}">
> >>       <to pattern="InOut" uri="direct:xyzProcQuote"/>
> >>  </get>
> >> </rest>
> >> ...
> >> call the service with http://serverName:8181/rest/XYZ/getQuote/nnn

> >> receive a 404 url not found
> >>
> >>
> >>
> >> What i missed ?
> >> Do i have to refered the http servlet someware in my camel Context
?
> >>
> >>
> >> Thank's
> >>
> >>
> >> Daniel Langevin
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> "Le présent courriel peut contenir des renseignements
confidentiels et
> ne s'adresse qu'au destinataire dont le nom apparaît ci-dessus. Si
ce
> courriel vous est parvenu par mégarde, veuillez le supprimer et nous
en
> aviser aussitôt."
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2 
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2 
>


"Le présent courriel peut contenir des renseignements confidentiels et ne s'adresse qu'au destinataire dont le nom apparaît ci-dessus. Si ce courriel vous est parvenu par mégarde, veuillez le supprimer et nous en aviser aussitôt."