camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vlad Olenin" <vole...@gmail.com>
Subject Re: route definition: component response routing
Date Thu, 10 Jul 2008 19:29:05 GMT
Yes, I actually meant smth like this. For example, for a more complex route:

from("bean:xxx")
  .pipeline("bean:yyy", "direct:z", "direct:x", "bean:result")

when I call it with

       Object response = template.requestBody("bean:xxx", "Hello");
       assertEquals("Hello World", response);

what is the preferred way to retrieve a response: from the "bean:result"
request object, or from the result of evaluation of the initial call? In
case of the various pipelines and routers chained together, would the
response be propogated back? In which cases it woudn't? I'm assuming if
there is a 'seda' component in the chain, the only option to get the result
would be from the 'bean:result' (the last component in the chain), correct?

In other words, how to define / know the channel type: 'in-only', 'in-out',
'in-optional out', etc...

Thanks,

Vlad


On Tue, Jul 8, 2008 at 6:57 AM, Claus Ibsen <ci@silverbullet.dk> wrote:

> Hi
>
> Vladim could you give an example? I read your question a bit differently
> than Charles.
>
> If you mean what Camel does if you have a route like this?
>
> from("xxx")
>
> And you send an exchange to "xxx". Then Camel will process the exchange and
> return a response to the client.
>
> Eg: as this unit test demonstrates:
>
>    public void testNoToType() throws Exception {
>        Object response = template.requestBody("direct:in", "Hello");
>        assertEquals("Hello World", response);
>    }
>
>    protected RouteBuilder createRouteBuilder() throws Exception {
>        return new RouteBuilder() {
>            public void configure() throws Exception {
>                from("direct:in").process(new Processor() {
>                    public void process(Exchange exchange) throws Exception
> {
>                        String body =
> exchange.getIn().getBody(String.class);
>                        exchange.getOut(true).setBody(body + " World");
>                    }
>                });
>            }
>        };
>    }
>
>
> Med venlig hilsen
>
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
> -----Original Message-----
> From: cmoulliard [mailto:cmoulliard@gmail.com]
> Sent: 8. juli 2008 09:05
> To: camel-user@activemq.apache.org
> Subject: Re: route definition: component response routing
>
>
> Hi Vlad,
>
> If the destination endpoint is not defined, an error will be generated when
> your message will be send. Different strategies exist to avoid to lost your
> message in this situation :
>
> - Implement a DeadLetterchannel,
> - Define your "from" endpoint as a transactional endpoint to provide a
> rollback
>
> Regards,
>
> Charles
>
>
> volenin wrote:
> >
> > Does anyone have any suggestion re: this question?...
> >
> >
> > On Sun, Jun 29, 2008 at 5:47 PM, Vlad Olenin <volenin@gmail.com> wrote:
> >
> >> Hi,
> >>
> >> I was browsing through the documentation recently trying to find the
> >> answer
> >> for the following question. If the outbound route from one of the
> >> endpoints
> >> is not defined, does it mean that the response that component is
> creating
> >> would be propagated back through the request chain? Or it would just
> >> terminate on that endpoint? In other words, does Camel behavior in this
> >> case
> >> resembles that of Mule or not? (From what I read, in Mule if the
> outbound
> >> route is not defined, the message would 'bounce back' along the
> >> invocation
> >> chain towards the original caller).
> >>
> >> Thanks,
> >>
> >> Vlad
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/route-definition%3A-component-response-routing-tp18185736s22882p18333101.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message