You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Taariq Levack <ta...@itaro.co.za> on 2010/06/16 12:22:25 UTC

How to set RoutePolicyRef in java DSL

Hi

I'm using Spring to set up the context but java to build the routes.
I've got the bean for throttling route policy defined in Spring as per the example
and in the java route I tried this during configure, after adding a route...

        RoutesDefinition routeDef = getRouteCollection();

        routeDef.route().setRoutePolicyRef("inflightRoutePolicy");

That throws a java.util.NoSuchElementException.

Can I do this in java or should I set up the routes in xml?

Taariq

RE: How to set RoutePolicyRef in java DSL

Posted by Taariq Levack <ta...@itaro.co.za>.
Oh nevermind this one either, this code works.
        from(pingEndpoint).routePolicyRef("inflightRoutePolicy").bean(PingProcessor.class).to(responseEndpoint);

Only problem I have now is testing my routers with CamelTestSupport, I guess I'll have to switch to CamelSpringTestSupport.

Taariq

-----Original Message-----
From: Taariq Levack [mailto:taariql@itaro.co.za]
Sent: 16 June 2010 12:22 PM
To: users@camel.apache.org
Subject: How to set RoutePolicyRef in java DSL

Hi

I'm using Spring to set up the context but java to build the routes.
I've got the bean for throttling route policy defined in Spring as per the example
and in the java route I tried this during configure, after adding a route...

        RoutesDefinition routeDef = getRouteCollection();

        routeDef.route().setRoutePolicyRef("inflightRoutePolicy");

That throws a java.util.NoSuchElementException.

Can I do this in java or should I set up the routes in xml?

Taariq