Thanks JB and Markus,

This is very close to what I am looking for (I still need to read more the 
examples) but in my particular case, I am using Camel Rest DSL (with servlet 
component) connecting it to the OSGi managed org.osgi.service.http.HttpService. 
 In other words, I am not using the Camel Jetty component for my rest services. 
 This is how I am setting up Camel to use the OSGi HTTP Service:

        <reference id="httpService" 
interface="org.osgi.service.http.HttpService" />
        <bean id="camelServlet" 
class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>
        <bean 
class=“org.apache.camel.component.servlet.osgi.OsgiServletRegisterer" 
init-method="register" destroy-method="unregister”>
                <property name="alias" value="#{context.path}#{api.root.path}" 
/>
                <property name="httpService" ref="httpService" />
                <property name="servlet" ref="camelServlet" />
                <property name="servletName" value="RestApiServlet"/>
                <property name="matchOnUriPrefix" value="true"/>
        </bean> 

        <restConfiguration component=“servlet" bindingMode="xml" 
contextPath="{{context.path}}{{api.root.path}}" 
                        port="{{port}}"
                        enableCORS="false"
                        clientRequestValidation="true">
                        <componentProperty key="matchOnUriPrefix" value="true"/>
                        <endpointProperty key="servletName" 
value="RestApiServlet”/>
        ...


So, the question is how do I bind the Camel servlet to a specific Jetty 
connection?
Would the MANIFEST headers do it?  If so, then that applies to the entire 
bundle.

Best regards,
Alex soto




> On Jan 31, 2020, at 9:06 AM, Markus Rathgeb <[email protected]> wrote:
> 
> Hi JB,
> 
> as I comment that link already in the first thread and also answered
> to your link in the second thread:
> 
>> Isn't this similar to this thread (at least after some comments):
>> https://lists.apache.org/thread.html/69182ee8feef88896f840efde48146053997119e820ef037853c1c9b@%3Cuser.karaf.apache.org%3E
>> You also referenced to http://blog.nanthrax.net/?p=352
>> My observations has been that it should work for "Web Bundles" and I
>> did not found (that time) a way to get it working for servlets.
> 
> May I ask you if you already checked that this is really still working
> for servlets?

Reply via email to