java - Load Balancing webservers using Httpurlconnection on client side -


my application needs connect web service xml data. have 4 web service endpoints.

what best way load balance between web service?

i know best way use hardware/software load balancer have on client side.

i have develop client using httpurlconnection working fine 1 end point.

i planning use hashmap url's , after call 1 one.

regards, imran

without central point co-ordinate distribution of connections between service endpoints, you're pretty limited choosing arbitrary one-of-four each time establish connection. reasonable approach may use each endpoint in turn successive interactions client (starting 1 chosen @ random ensure there isn't heavy bias towards single endpoint @ times when clients may restarted).

alternatively, implement endpoint returns preferred connection, client make subsequent calls. implementation assign clients round robin style, or reference load reported each endpoint @ given time.

of 2 approaches, former far simpler , should give reasonably distribution across endpoints. latter allow additional endpoints added without requiring clients updated.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -