Open bfitzpat opened 5 years ago
To enable standalone testing, we can...
Comment out the generated camel servlet options in the generated config:
<!-- Setup camel servlet with OSGi HttpService -->
<!-- <reference id="httpService" interface="org.osgi.service.http.HttpService"/>
<bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
init-method="register"
destroy-method="unregister">
<property name="alias" value="/wsdl2rest"/>
<property name="httpService" ref="httpService"/>
<property name="servlet" ref="camelServlet"/>
</bean>
<bean id="camelServlet" class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/> -->
Change the restConfiguration element to use the jetty component:
<restConfiguration component="jetty" host="localhost" port="8081" bindingMode="json">
</restConfiguration>
And add the following dependencies to the pom.xml:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>5.2</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>5.0.0</version>
</dependency>
I am unsure how to make a single configuration work so that it can be deployed on Karaf/OSGi and tested in standalone mode. Waiting for some feedback from Freeman to see if that's possible.
Though the Blueprint velocity template generates a valid configuration for OSGi deployment, it does not currently allow for standalone testing like the Spring template does. We will need to investigate how to adjust the template to enable both cases or provide one case to rule them all.