camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Fastet way to check the size of a soap request ?
Date Fri, 05 Sep 2014 08:58:49 GMT
The type of the message body is StreamCache so you can do, just
declare a method with that type.

Read about bean binding in the Camel docs, or chapter 4 in the Camel
in Action book.

public boolean isBigStream(StreamCache cache)  {
   return cache.length() > 9999999;
}


Or if you want to use the Camel Exchange type

public void doSomething(Exchange exchange)
   StreamCache cache = exchange.getIn().getBody(StreamCache.class);
   ...



On Fri, Sep 5, 2014 at 10:15 AM, Frankiboy <mail.to.frankj@gmail.com> wrote:
> Thanks i can se that i can to something like this:
>
>
> from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching().getStreamCache().length();
>
> I want this value in my bean, soo i can log something, when the size is
> bigger then 20mb.
>
>
> But how do i get this length down in my bean, via my DSL syntax,
>
>   from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
>              bean(AddIpBean.class);
>
>
> Frank
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Fastet-way-to-check-the-size-of-a-soap-request-tp5756054p5756085.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message