| Summary | How to use proxy based load balancing for an Orbix replicated server. | 
|---|---|
| Article Number | 17111 | 
| Environment | Orbix 6.3 Orbix Java Runtime | 
| Question/Problem Description | How to use proxy based load balancing for an Orbix replicated server. How to implement proxy based load balancing for a a replicated server How to use the ClientLoadBalancingPolicy How to use com.iona.corba.IT_CORBA.CLIENT_LOAD_BALANCING_POLICY_ID How to use Orbix client side load balancing | 
| Clarifying Information | |
| Error Message | |
| Defect/Enhancement Number | |
| Cause | |
| Resolution | As documented in the Administrator's Guide, Orbix Java provides two client side load balancing strategies for replicated servers: 
 It is also possible to turn off the client side proxy binding reuse (described in point 1) by setting the com.iona.corba.IT_CORBA.CLIENT_LOAD_BALANCING_POLICY_ID policy. If the client side proxy binding is not reused, then each time a CORBA proxy is created, the ORB retrieves an IOR from the locator that specifies a server replica. All subsequent requests made on that CORBA proxy will be sent to the same server replica. To understand how com.iona.corba.IT_CORBA.CLIENT_LOAD_BALANCING_POLICY_ID is used we need to understand when an ORB reuses a client side proxy binding. When a client application invokes the first operation on a CORBA Proxy, the ORB takes the following details into account as it determines whether or not it can reuse an existing client side proxy binding: 
 
 
 
 
 
 
 
 
 When two CORBA Proxies have all of the above details in common, they can share a client side proxy binding. By setting CLIENT_LOAD_BALANCING_POLICY_ID on a CORBA proxy, it introduces a new policy into the effective policy set for that CORBA proxy. The CORBA proxy is then considered "not equal" to another instance of that CORBA proxy with a different value for CLIENT_LOAD_BALANCING_POLICY_ID, hence preventing reuse/sharing of the client side proxy binding. The client side code sample below illustrates how to set CLIENT_LOAD_BALANCING_POLICY_ID on a CORBA proxy. 
 
 
 For details on client side load balancing strategies see Orbix Administrator's Guide, "Configuring Scalable Applications" - Per-Request Load Balancing..T face="Courier New">//retrieve IOR org.omg.CORBA.Object default_corba_obj = ... 
 //create policy with a unique (for that proxy) string value. Any any1 = orb.create_any(); any1.insert_string("one"); 
 Policy policies1[] = { orb.create_policy(CLIENT_LOAD_BALANCING_POLICY_ID.value, any1) }; //set policy org.omg.CORBA.Object modified_policy_obj = ObjectHelper.set_policy_overrides(default_corba_obj, policies1, SetOverrideType.ADD_OVERRIDE); //narrow to interface object in the standard way. SimpleObject simpleObject = SimpleObjectHelper.narrow(modified_policy_obj ); ... For details on client side load balancing strategies see Orbix Administrator's Guide, "Configuring Scalable Applications" - Per-Request Load Balancing.. | 
| Workaround | |
| Notes | |
| Attachment | 
| Created date: | 06 September 2011 | 
|---|---|
| Last Modified: | 13 February 2013 | 
| Last Published: | 23 June 2012 | 
| First Published date: | 10 September 2011 | 
#Orbix
#KnowledgeDocs

