Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update blueprint template to enable standalone testing as well as OSGi deployment #73

Open
bfitzpat opened this issue Dec 4, 2018 · 2 comments
Labels
Milestone

Comments

@bfitzpat
Copy link
Contributor

bfitzpat commented Dec 4, 2018

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.

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 4, 2018

To enable standalone testing, we can...

  1. 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"/> -->
  1. Change the restConfiguration element to use the jetty component:
        <restConfiguration component="jetty" host="localhost" port="8081" bindingMode="json">
        </restConfiguration>
  1. 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>

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Dec 4, 2018

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.

@tdiesler tdiesler added the task label Jan 30, 2019
@tdiesler tdiesler added this to the 0.9.0 milestone Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants