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: Exception on adding throttle "Definition has no children on Throttle"
Date Tue, 22 Jul 2014 18:12:34 GMT
Hi

You need to use the fluent builder that is returned, something alike this

  ProcessorDefinition pd = from(fromEndpoint)
    if(throttleOn){
      pd = pd.throttle(10)
   }
   pd = pd.process(someProcessor)

On Tue, Jul 22, 2014 at 8:03 PM, dermoritz <tanteanni@hotmail.com> wrote:
> i am creating some routes with jave in a for loop (all is working fine). now
> i need to add "throttle" to the outer route definition" but with it i get:
> Exception in thread "main" org.apache.camel.FailedToCreateRouteException:
> Failed to create route cepToRtdmdfESP://192.168.154.128:55555/TEST/TEST/PCRF
> _DATA_USAGE_STREAM at: >>> Throttle[{10} request per 1000 millis -> []] <<<
> in route: Route(cepToRtdmdfESP://192.168.154.128:55555/TEST/TEST/PCRF_...
> because of Definition has no children on Throttle[{10} request per 1000
> millis -> []]
>
> the structure is as follows (pseudo code) - all in "configure()"
> foreach(fromEndpoint){
>    RouteDefinition rd = from(fromEndpoint)
>    if(throttleOn){
>       rd.throttle(10)
>    }
>    rd.process(someProcessor)
>    MulticastDefinition md = rd.multicast();
>    //targets
>    foreach(targets){
>         md.to(target)
>    }
> }
>
> what went wrong? how to throttle correctly?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Exception-on-adding-throttle-Definition-has-no-children-on-Throttle-tp5754255.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