To use properties in spring xml, you can use 
BridgePropertyPlaceholderConfigurer documented here
http://camel.apache.org/using-propertyplaceholder.html 
<http://camel.apache.org/using-propertyplaceholder.html>
 
> On 17 Jan 2017, at 7:17 am, bob_sheknowdas <[email protected]> wrote:
> 
> Hi,
> 
> im trying to set up a load balancer using Apache Camel.
> 
> Everything works fine, if I use the spring configuration:
> 
>    <route id="route2">
>      <from uri="servlet:///api2/data/?matchOnUriPrefix=true"/>
>         <loadBalance>
>               <failover roundRobin="true" maximumFailoverAttempts="3"/>
>               <to
> uri="http://localhost:8080/api2/data/?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/>
>         </loadBalance>
>    </route>
> 
> But if I try to use the RouteBuilder class i get Errors:
> 
> 
> from("servlet:///api2/data/?matchOnUriPrefix=true").loadBalance().failover(3,
> false, true)
> 
> .to("http://localhost:8080/api2/data/?bridgeEndpoint=true&amp;throwExceptionOnFailure=false";);
> 
> The Error is an Http 500, so not really specific.
> Has anyone an Idea, why that is?
> 
> 
> Possible workaround:
> I wanted to use the RouteBuilder class since I want to read in possible
> target servers from a properties file. If anyone knows a way to do that via
> spring I would be most happy to learn from you : )
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Load-Balancing-Fluent-Builders-vs-Spring-tp5792636.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to