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, the<to uri="http://0.0.0.0:9080/send/license"/>  endpoint in the
route is a second instance of the service running at<to
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:

<route id="myRoute" streamCache="true">
<from uri="servlet:///license"/>
<to uri="http://192.168.22.95:8135/transform-service/send/license"/>
</route>

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.
<to uri="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:

<web-app>
<!-- location of spring xml files -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!-- Camel servlet -->
<servlet>
<servlet-name>MulticastServlet</servlet-name>
<servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>


<load-on-startup>1</load-on-startup>
</servlet>
<!-- Camel servlet mapping -->
<servlet-mapping>
<servlet-name>MulticastServlet</servlet-name>
<url-pattern>/send/*</url-pattern>
</servlet-mapping>
<!-- the listener that kick-starts Spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>


</listener>
<welcome-file-list>
<welcome-file>WEB-INF/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>

Here's my camel context and route:

<camelContext trace="true" id="multicastCtx"
xmlns="http://camel.apache.org/schema/spring";>
<route id="multicastRoute">
<from uri="servlet:///license"/>
<multicast stopOnException="false">
<to uri="http://192.168.22.95:8135/transform-service/send/license"/>
<to uri="http://0.0.0.0:9080/send/license"/>
</multicast>
</route>
</camelContext>

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




Reply via email to