camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: how to specify which method when calling a direct route?
Date Thu, 08 Mar 2012 07:08:38 GMT

What version of Camel are you using?

And what does your direct route look like?

Setting a header with the key "CamelBeanMethodName" ought to take
precedence on the name of the method to invoke.
eg the key name is from a constant on Exchange.BEAN_METHOD_NAME

You can enable and use the tracer to see what the message contains
when being routed, to see the header is present when it hit the bean

On Wed, Mar 7, 2012 at 8:21 PM, codemonkey73
<> wrote:
> We've built a small directory of services (POJOs) for which we have built
> direct to bean routes.  They've worked so far when using a ProducerTemplate
> to call the direct route.  To specify the method when using
> ProducerTemplate, we use requestBodyAndHeader("direct:myService",
> [methodparameterOrNull], "CamelBeanMethodName", "myServiceMethodSignature").
> Now I'm trying to call these services from an established web project which
> doesn't use spring or camel. I'm trying to minimize the changes to that
> project and keep spring and camel out, so I thought I would try to set up a
> servlet route in the Camel project, and then route that servlet call to the
> services directory via a direct route.  The simple servlet routing is
> working, but what I can't figure out is the routing from the servlet to the
> existing direct routes of the services.
> I've tried variations of the following:
> from("servlet:///servletRouteMapping").
> setHeader("CamelBeanMethodName", constant("myServiceMethodSignature")).
> to("direct:myService");
> The response my client gets is 'Not Implemented Yet'.
> I was planning on using different servlet mappings and routes for each of
> the methods of the service.
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message