Refactoring some legacy camel code, is this code unnecessary or am I missing something?

70 views Asked by At

I'm refactoring some apache camel legacy code in a JBoss Fuse instance and I've run into some code that I'm not sure what it's purpose is for.

   <when condition>
       <loadBalance id="someVar">
          <failover roundRobin="true" maximumFailoverAttempts="3" />
           <to uri="fabric:FABRICENDPOINT" />
       </loadBalance>
    </when>

I haven't used Fabric's load balancer before but from what I understand the configuration of it is set up on the server side. Is there any point of having an additional load balancer before a message gets sent to the fabric endpoint? There are a bunch of similar load balancer like this (1 endpoint to a fabric endpoint) and I'm not sure if I can just direct the message straight to the fabric endpoint.

Thanks all

1

There are 1 answers

0
Claus Ibsen On BEST ANSWER

Yes the fabric endpoint has built in load balancing where it round robin among the online endpoints. But it does not have built in redelivery, so if you remove the above, you lose out the maximumFailoverAttempts functionality.

But Apache Camel provides general error handler where you can also configure it to perform maximumRedeliveries and set that to a value.