Hi Maybe CXF has some interceptor to limit accepting big payloads? But I am not sure.
In Camel and as you are using stream caching, there is a length operation so you can know how big the stream is http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/StreamCache.html You can use that in a filter / content based router / interceptor or whatever you want. It kinda depends what you need to do if its > 20MB. On Fri, Sep 5, 2014 at 8:25 AM, Frankiboy <[email protected]> wrote: > I have to stop the camel route if the request ist bigger then 20 MB. > > Normal i will think i have to intercept the incoming request stream and > buffer it all in to see the total size, then generate a new stream and hand > it to the SOAP service if desired. Sounds like a job for a filter to me. > > But now am in camel... So i Thought maybe i could use > > exchange.getIn().getBody(); > exchange.getIn().getHeaders(); > > My route lookes like this: > > > from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching().onException(Exception.class) > .process(new > LogError()).end().bean(AddIpBean.class).bean(SetRoutingKey.class) > .bean(Util.class, > "setMiljo").multicast().to("direct:channel1", "direct:channel2", > "direct:channel3") > .aggregationStrategy(new > HubAggregationStrategy()).stopOnException(); > > > > Can i do this in a nice way ? > > Frank > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Fastet-way-to-check-the-size-of-a-soap-request-tp5756054.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
