In Java you need to use & and not & for separate in query parameters. So check your to endpoint.
On Mon, Jan 16, 2017 at 9:17 PM, 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&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&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. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
