You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Klaus777 <ma...@gmail.com> on 2013/10/02 19:46:20 UTC

Camel + RESTLET in Tomcat/Jetty

As far as I understand, Camel by default uses the default RESTLET engine. How
can I tell Camel to use Jetty for RESTLEY instead?

I know there are ways to bundle an application and deploy it in Tomcat or
Jetty. If I do that, however, the biggest question becomes how to integrate
with RESTLET.

I did some digging. I took one of the tomcat examples that come with camel.
Then I tried to make deploy the RESTLET servlet. It almost works. 
My Spring Camel configuration is given below as well as my web.xml. The
problem now is that the parameters are not being passed to the route. I
would expect that when calling this server:
http://localhost:8080/rs/user/?name=Paul, I would get: Hello Paul how are
you?

Instead, I simply get: Hello how are you?
PS: The container is Tomcat.

Camel Spring config:
 <camelContext xmlns="http://camel.apache.org/schema/spring">

   <route>
   	<from uri="restlet:/user/?restletMethods=GET,POST"/>
   	  <transform>
            <simple>Hello ${header.name} how are you?</simple>
          </transform>
   </route>
  </camelContext>
<bean id="RestletComponent" class="org.restlet.Component"/>
<bean id="RestletComponentService"
class="org.apache.camel.component.restlet.RestletComponent">
   <constructor-arg index="0">
     <ref bean="RestletComponent"/>
   </constructor-arg>
</bean> 

Web.xml:
<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:camel-config.xml</param-value>
	</context-param>
	<listener>
	
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<servlet>
		<servlet-name>RestletServlet</servlet-name>
		<servlet-class>org.restlet.ext.spring.SpringServerServlet</servlet-class>
		<init-param>
			<param-name>org.restlet.component</param-name>
			<param-value>RestletComponent</param-value>
		</init-param>
	</servlet>
	<servlet-mapping>
		<servlet-name>RestletServlet</servlet-name>
		<url-pattern>/rs/*</url-pattern>
	</servlet-mapping>



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-RESTLET-in-Tomcat-Jetty-tp5740778.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel + RESTLET in Tomcat/Jetty

Posted by Klaus777 <ma...@gmail.com>.
Issue resolved as described here: 
http://stackoverflow.com/questions/19128361/restlet-on-camel-with-jetty/19148768#19148768
<http://stackoverflow.com/questions/19128361/restlet-on-camel-with-jetty/19148768#19148768>  



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-RESTLET-in-Tomcat-Jetty-tp5740778p5740787.html
Sent from the Camel - Users mailing list archive at Nabble.com.