Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a good open source abstract load balancing library for Java? [closed]

I'm looking for an open source library that will allow programmatic loadbalancing across a set of calls to nodes of arbitrary form - so no assumptions about HTTP or anything else, just a method call on an object. Ideally it would provide the following functionality:

  • Balances the load equally
  • Retry on a different node if a call to a node throws an exception
  • Move a node to a "broken" state if a call to it fails, and make no further calls to it
  • Have a mechanism for doing background pings to all nodes (broken and active) that will restore broken ones to active state when they return and proactively move active ones to broken state if they fail

I feel this ought to exist already, but some googling has yet to find it.

like image 669
Robert Elliot Avatar asked May 29 '12 10:05

Robert Elliot


People also ask

Which load balancing solution is recommended?

jetNEXUS is the best one for enterprises that want advanced traffic load management features. Other load balancer apps that are suitable for medium and big enterprises include Total Uptime Cloud Load Balancer, Citrix ADC, Nginx, and Avi Vantage Software Load Balancer.

What popular open source Web server can also perform as a load balancer?

HAProxy. ‍HAProxy is an L4 and L7 load balancer supporting TCP and UDP traffic. It's a well-established, open source solution used by companies such as Airbnb and GitHub. HAProxy is also a very capable L7 load balancer, supporting HTTP/2 and gRPC backends.

What is the difference between L4 and L7 load balancers?

L4 load balancing delivers traffic with limited network information with a load balancing algorithm (i.e. round-robin) and by calculating the best server based on fewest connections and fastest server response times. L7 load balancing works at the highest level of the OSI model.

Does Eureka do load balancing?

What is Eureka? Eureka is a REST based service that is primarily used in the AWS cloud for locating services for the purpose of load balancing and failover of middle-tier servers. We call this service, the Eureka Server.


2 Answers

Consider using Apache Camel library. There is a flexible load balancer and the library have a vast variety of components so you don't stick to particular protocol or service implementation. With Camel Bean component you can load-balance even POJO method calls.

like image 144
Konstantin V. Salikhov Avatar answered Oct 21 '22 16:10

Konstantin V. Salikhov


You could also look at JavaSpaces. The paradigm there is a simple queue. The least active processor is the most likely to take the next item on the queue.

like image 34
user207421 Avatar answered Oct 21 '22 15:10

user207421