You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by unludo <un...@gmail.com> on 2012/03/30 15:42:21 UTC
defaultEndpoint must be specified with seda request/reply
When running this program I get the message 'defaultEndpoint must be
specified'. Could you help me understand why?
Thank you!
public static void main(String args[]) throws Exception
{
// create CamelContext
CamelContext context = new DefaultCamelContext();
// add our route to the CamelContext
context.addRoutes(new RouteBuilder()
{
public void configure()
{
from("seda:backend").inOut("http4://10.11.144.78:8080/pvaa-backend/rest/v1/users/json");
}
}
);
// start the route and let it do its work
context.start();
ProducerTemplate template = context.createProducerTemplate();
Object result = template.requestBody("seda:backend");
Thread.sleep(30000);
context.stop();
}
--
View this message in context: http://camel.465427.n5.nabble.com/defaultEndpoint-must-be-specified-with-seda-request-reply-tp5606712p5606712.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: defaultEndpoint must be specified with seda request/reply
Posted by Christian Müller <ch...@gmail.com>.
If you look at the JavaDoc, you will see that:
template.requestBody("seda:backend");
will send the String "seda:backend" to the default Endpoint which you
didn't specify.
You have to possible solutions:
1) set the default endpoint:
createProducerTemplate.setDefaultEndpointUri("seda:backend")
2) provide the endpoint in the requestBody method
template.requestBody("seda:backend", "body");
Best,
Christian
On Fri, Mar 30, 2012 at 3:42 PM, unludo <un...@gmail.com> wrote:
> When running this program I get the message 'defaultEndpoint must be
> specified'. Could you help me understand why?
> Thank you!
>
> public static void main(String args[]) throws Exception
> {
> // create CamelContext
> CamelContext context = new DefaultCamelContext();
>
> // add our route to the CamelContext
> context.addRoutes(new RouteBuilder()
> {
> public void configure()
> {
>
> from("seda:backend").inOut("http4://
> 10.11.144.78:8080/pvaa-backend/rest/v1/users/json");
> }
> }
>
> );
>
> // start the route and let it do its work
> context.start();
> ProducerTemplate template = context.createProducerTemplate();
>
> Object result = template.requestBody("seda:backend");
>
> Thread.sleep(30000);
>
> context.stop();
> }
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/defaultEndpoint-must-be-specified-with-seda-request-reply-tp5606712p5606712.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>