can't route from servlet component to http component
I'm trying to configure a multicast route that receives an HTTP POST and POSTs it to multiple instances of a service. From reading the documentation, the book, this list, and playing with the camel-example-servlet-tomcat, it looks like it should be simple, but i'm stuck. Here's my web.xml for configuring the Camel Servlet: contextConfigLocation /WEB-INF/applicationContext.xml MulticastServlet org.apache.camel.component.servlet.CamelHttpTransportServlet 1 MulticastServlet /send/* org.springframework.web.context.ContextLoaderListener WEB-INF/index.xhtml Here's my camel context and route: xmlns="http://camel.apache.org/schema/spring";> http://192.168.22.95:8135/transform-service/send/license"/> http://0.0.0.0:9080/send/license"/> The service expects data in request parameters. i can post directly to both endpoint URIs with an http tool ("Poster" plugin for Firefox) successfully. However, when i post to this webapp (running in Jetty), at the URI "http://localhost:8080/send/license"; i get a 404 error. In the Jetty debug log, i see "DEBUG [CamelHttpTransportServlet.service]: No consumer to service request [POST /send/license]" I suspect i'm missing something obvious in configuring the URI for the Camel servlet. thanks in advance, Joe -- *Joe Niski* Senior Developer - Information Services | NWEA™ PHONE 503.548.5207 | FAX 503.639.7873 NWEA.ORG <http://www.nwea.org/> | Partnering to help all kids learn™
Re: can't route from servlet component to http component
i should have mentioned that i'm using camel 2.7.1. *Joe Niski* Senior Developer - Information Services | NWEA™ PHONE 503.548.5207 | FAX 503.639.7873 NWEA.ORG <http://www.nwea.org/> | Partnering to help all kids learn™ On 10/18/2011 04:18 PM, Joe Niski wrote: I'm trying to configure a multicast route that receives an HTTP POST and POSTs it to multiple instances of a service. From reading the documentation, the book, this list, and playing with the camel-example-servlet-tomcat, it looks like it should be simple, but i'm stuck. Here's my web.xml for configuring the Camel Servlet: contextConfigLocation /WEB-INF/applicationContext.xml MulticastServlet org.apache.camel.component.servlet.CamelHttpTransportServlet 1 MulticastServlet /send/* org.springframework.web.context.ContextLoaderListener WEB-INF/index.xhtml Here's my camel context and route: http://camel.apache.org/schema/spring";> http://192.168.22.95:8135/transform-service/send/license"/> http://0.0.0.0:9080/send/license"/> The service expects data in request parameters. i can post directly to both endpoint URIs with an http tool ("Poster" plugin for Firefox) successfully. However, when i post to this webapp (running in Jetty), at the URI "http://localhost:8080/send/license"; i get a 404 error. In the Jetty debug log, i see "DEBUG [CamelHttpTransportServlet.service]: No consumer to service request [POST /send/license]" I suspect i'm missing something obvious in configuring the URI for the Camel servlet. thanks in advance, Joe
Re: can't route from servlet component to http component
thanks, Willem, but that didn't improve my results. According to the stream-caching page you referenced, the Multicast component "will implicitly cache streams to ensure that all the endpoints can access the message content"; setting it explicitly does not change the behavior. Also, the http://0.0.0.0:9080/send/license"/> endpoint in the route is a second instance of the service running at uri="http://192.168.22.95:8135/transform-service/send/license"/> -- the goal of this route is to recceive a service call and multicast it. The second instance is simply running on my local machine (on a different port than the Jetty server that's hosting my route). To simplify the route, i dropped the multicast component, so it looks like this: http://192.168.22.95:8135/transform-service/send/license"/> When i post to the servlet, i still get the same error: "[CamelHttpTransportServlet.service]: No consumer to service request [POST /send/license" - to me, it looks like the request isn't reaching the servlet. thanks again, Joe *Joe Niski* Senior Developer - Information Services | NWEA™ PHONE 503.548.5207 | FAX 503.639.7873 NWEA.ORG <http://www.nwea.org/> | Partnering to help all kids learn™ On 10/18/2011 09:17 PM, Willem Jiang wrote: First you need to cache the stream[1] for posting it across different endpoints. http://0.0.0.0:9080/send/license"/> will create a producer, it doesn't listen to the address as you want. [1]http://camel.apache.org/stream-caching.html On 10/19/11 7:18 AM, Joe Niski wrote: I'm trying to configure a multicast route that receives an HTTP POST and POSTs it to multiple instances of a service. From reading the documentation, the book, this list, and playing with the camel-example-servlet-tomcat, it looks like it should be simple, but i'm stuck. Here's my web.xml for configuring the Camel Servlet: contextConfigLocation /WEB-INF/applicationContext.xml MulticastServlet org.apache.camel.component.servlet.CamelHttpTransportServlet 1 MulticastServlet /send/* org.springframework.web.context.ContextLoaderListener WEB-INF/index.xhtml Here's my camel context and route: http://camel.apache.org/schema/spring";> http://192.168.22.95:8135/transform-service/send/license"/> http://0.0.0.0:9080/send/license"/> The service expects data in request parameters. i can post directly to both endpoint URIs with an http tool ("Poster" plugin for Firefox) successfully. However, when i post to this webapp (running in Jetty), at the URI "http://localhost:8080/send/license"; i get a 404 error. In the Jetty debug log, i see "DEBUG [CamelHttpTransportServlet.service]: No consumer to service request [POST /send/license]" I suspect i'm missing something obvious in configuring the URI for the Camel servlet. thanks in advance, Joe
Re: can't route from servlet component to http component
You're right, there was a problem with my Spring ApplicationContext, once i stragitened that out everything works as expected. Thanks for the responses, i appreciate it. Joe On Wed 19 Oct 2011 09:30:07 PM PDT, Willem Jiang wrote: Hi It looks like the camel context is not loaded rightly. Are you following the configuration of camel-example-servlet-tomcat? Which version of Camel are you using ? Can you try the latest release Camel 2.8.1 ? On Thu Oct 20 00:16:22 2011, Joe Niski wrote: thanks, Willem, but that didn't improve my results. According to the stream-caching page you referenced, the Multicast component "will implicitly cache streams to ensure that all the endpoints can access the message content"; setting it explicitly does not change the behavior. Also, thehttp://0.0.0.0:9080/send/license"/> endpoint in the route is a second instance of the service running athttp://192.168.22.95:8135/transform-service/send/license"/> -- the goal of this route is to recceive a service call and multicast it. The second instance is simply running on my local machine (on a different port than the Jetty server that's hosting my route). To simplify the route, i dropped the multicast component, so it looks like this: http://192.168.22.95:8135/transform-service/send/license"/> When i post to the servlet, i still get the same error: "[CamelHttpTransportServlet.service]: No consumer to service request [POST /send/license" - to me, it looks like the request isn't reaching the servlet. thanks again, Joe *Joe Niski* Senior Developer - Information Services | NWEA™ PHONE 503.548.5207 | FAX 503.639.7873 NWEA.ORG<http://www.nwea.org/> | Partnering to help all kids learn™ On 10/18/2011 09:17 PM, Willem Jiang wrote: First you need to cache the stream[1] for posting it across different endpoints. http://0.0.0.0:9080/send/license"/> will create a producer, it doesn't listen to the address as you want. [1]http://camel.apache.org/stream-caching.html On 10/19/11 7:18 AM, Joe Niski wrote: I'm trying to configure a multicast route that receives an HTTP POST and POSTs it to multiple instances of a service. From reading the documentation, the book, this list, and playing with the camel-example-servlet-tomcat, it looks like it should be simple, but i'm stuck. Here's my web.xml for configuring the Camel Servlet: contextConfigLocation /WEB-INF/applicationContext.xml MulticastServlet org.apache.camel.component.servlet.CamelHttpTransportServlet 1 MulticastServlet /send/* org.springframework.web.context.ContextLoaderListener WEB-INF/index.xhtml Here's my camel context and route: http://camel.apache.org/schema/spring";> http://192.168.22.95:8135/transform-service/send/license"/> http://0.0.0.0:9080/send/license"/> The service expects data in request parameters. i can post directly to both endpoint URIs with an http tool ("Poster" plugin for Firefox) successfully. However, when i post to this webapp (running in Jetty), at the URI "http://localhost:8080/send/license"; i get a 404 error. In the Jetty debug log, i see "DEBUG [CamelHttpTransportServlet.service]: No consumer to service request [POST /send/license]" I suspect i'm missing something obvious in configuring the URI for the Camel servlet. thanks in advance, Joe