camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilgin Ibryam <>
Subject Re: Invoking Servlet from Camel
Date Mon, 29 Jul 2013 10:58:45 GMT
Hi Syed,

what you have done should work.
If you set a message body http4 component will use POST method to do
the http call and sent the message body as post body.

Have a look here

You can also set the http method manually if you prefer, like this:

But notice that in this case, in your servlet you will get the call
from doPost method and not from doGet


On 29 July 2013 11:38, SyedBhai <> wrote:
> Hi guys,
>   I am having a servlet.  It expects one parameter, say 'message'.
>   I want to invoke it using camel.
>   I am able to invoke it successfully as a HTTP GET method as follows:
> from("direct:start").to("");
>     String response=template.requestBody("direct:start", null,
> String.class);
>   What I want is instead of passing the parameter in the query string, can I
> pass it as a message body?
>     String response=template.requestBody("direct:start", "HelloCamel",
> String.class);
>   Is there a way to accomplish this?
>   I have already visited Camel Servlet Component webpage.
>   It doesn't help.
> Thanks,
> Syed.
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

View raw message