You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dermoritz <ta...@hotmail.com> on 2014/07/22 20:03:18 UTC

Exception on adding throttle "Definition has no children on Throttle"

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.

Re: Exception on adding throttle "Definition has no children on Throttle"

Posted by dermoritz <ta...@hotmail.com>.
Thanks for quick reply (it is working),

the only downside on this is i can't call autoStartup(false) on
ProcessorDefinition. The only workaround i see is to use another variable
for ThrottleDefinition or set autoStartup on RouteDefinition and then cast
to ProcessorDefinition?





--
View this message in context: http://camel.465427.n5.nabble.com/Exception-on-adding-throttle-Definition-has-no-children-on-Throttle-tp5754255p5754258.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exception on adding throttle "Definition has no children on Throttle"

Posted by Claus Ibsen <cl...@gmail.com>.
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 <ta...@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/