camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: [DISCUSS] from DSL with a class parameter for expected body type
Date Thu, 30 Jun 2011 10:28:27 GMT
On Thu, Jun 30, 2011 at 12:16 PM,  <mitko.kolev@icw.de> wrote:
> Hi devs,
>
> does it make sense to extend the DSL with an additional from(...) method
> that asserts the type of the in message body? This might also help with
> the readability.
>
> for example,
> from("direct:input", MyExpectedInput.class)
>        ...

No that does not make sense.

There is a validate DSL you can use to assert the message body is a given type.
http://camel.apache.org/validate

from("direct:input")
    .validate(body().isInstanceOf(MyExpectedInput.class))
    .to("xxxx")


>
>
> Regards,
> Mitko
>
>
>
>
> InterComponentWare AG:
> Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler
> Aufsichtsratsvors.: Prof. Dr. Christof Hettich
> Firmensitz: 69190 Walldorf, Altrottstraße 31
> AG Mannheim HRB 351761 / USt.-IdNr.: DE 198388516



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message