Cannot get IceGrid round robin to work
Hi, Im having trouble getting the load balancing policy on my replica groups for my grid application to work as i think it should. What i want is that every other call i make on an "A" replica will be to SC_A_1, with the other going to SC_A_2 on the other node.
Here is a sample of the grid file im using for my app - we run 2 "A" servers and 2 "B"s. Ive removed the spurious java options/parameters for clarity.
Code:
<icegrid>
<application name="MyProcessApplication">
<replica-group id="A">
<load-balancing type="round-robin" />
<object identity="A" type="com::wind::MyProcess"/>
</replica-group>
<replica-group id="B">
<load-balancing type="round-robin"/>
<object identity="B" type="com::wind::MyProcess"/>
</replica-group>
<server-template id="MyProcess">
<server id="MyProcess-${index}-DEV" activation="manual" exe="/apps/jdk1.6.0_02/bin/java" pwd="${home}">
<option>-server</option>
<option>MyProcess</option>
<adapter name="MyProcessAdapter"
replica-group="${group}"
register-process="true"
endpoints="tcp -h ${server.ip.address}">
</adapter>
<property name="Ice.MessageSizeMax" value="20000"/>
</server>
</server-template>
<node name="PrimaryNode">
<server-instance template="MyProcess" index="1" group="A" server.ip.address="12.143.29.120" name="SC_A_1"/>
<server-instance template="MyProcess" index="3" group="B" server.ip.address="12.143.29.120" name="SC_B_1" />
</node>
<node name="SecondaryNode">
<server-instance template="MyProcess" index="2" group="A" server.ip.address="12.143.29.120" name="SC_A_2" />
<server-instance template="MyProcess" index="4" group="B" server.ip.address="12.143.29.120" name="SC_B_2" />
</node>
</application>
</icegrid>
My client code is
<CODE>
ObjectPrx prx = communicator.stringToProxy("A");
this.proxy = MyProcessPrxHelper.uncheckedCast(prx);
for (int i = 0; i < LOOPS; i++) {
logger.info("i: " + i + + " - " + proxy.getName());
}
</CODE>
Im expecting each call on the proxy to round robin e.g SC_A_1, SC_A_2, SC_A_1 etc. But i find it always invokes on SC_A_1 or SC_A_2 but every call then invokes on the same server.
Any ideas/advice?
Ian James
Equities IT, Deutsche Bank
London