|
|
|
|||||
|
Replica Groups and conections
I've set up a replica group with a load balancing type of Random. I have written a couple of test clients (in Python and Java) that connect to this group. The clients themselves are implemented as Ice Applications.
I can confirm that when I run a test client, it randomly selects one of the server endpoints for the connection. I have also added a loop to the test code where it attempts to select a new proxy each time through the loop. I find that within the test client, it always connects to the same server. Is this expected? My expectation was that I could connect to a different server for load balancing reasons. I have a replica group called, "CanonicServerGroup". My python test code looks like this: Code:
for r in range(repeat):
bProxy = self.communicator().stringToProxy("Boost@CanonicServerGroup")
boost = UrlIce.BoostPrx.checkedCast(bProxy)
.... more code to communicate with boost ....
Quote:
__________________
* John Eisenman * Wink Technologies (wink.com) |
|
|||||
|
Ice caches its results from registry lookups, so everytime you think you are getting a new object its just getting its cached copy
try setting this in your config file Code:
Ice.Default.LocatorCacheTimeout=0 |
|
|||||
|
Thanks. I set Ice.Default.LocatorCacheTimeout=0 for my client and now see all servers being used at random. In practice, I assume that we might set this to some number of seconds. Is this the proper way to achieve the result that I want?
__________________
* John Eisenman * Wink Technologies (wink.com) |
|
|||||
|
"Broadcast" to all members of a replica group?
Thanks for the above information; it was just what I needed.
I have related question. I have some functions that I'd like to call for all members of a replica group. As you mention, IceGrid can return all members of a replica group; how can I gain access to this information and call the same function on each?
__________________
* John Eisenman * Wink Technologies (wink.com) |
|
||||||
|
Hi,
You can retrieve the proxy of each individual replica with the IceGrid::Query::findAllReplicas method (introduced in Ice 3.2). Let us know if you need more information! Cheers, Benoit. |
|
|||||
|
Sounds like another reason to move to 3.2.
My project is currently running 3.1 (and won't be upgrading right away). Is there also a solution under 3.1? -John
__________________
* John Eisenman * Wink Technologies (wink.com) |
|
||||||
|
You could register a well-known object with the adapter descriptor. This well-known object would be registered with a given type which would be used to retrieve the proxies of each object with the IceGrid::Query::findAllObjectsByType method.
Cheers, Benoit. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| IceGrid Replica Names | zhi | Help Center | 1 | 12-26-2006 04:31 AM |
| maintaining replica state | Greenhippo | Help Center | 2 | 11-21-2006 04:25 AM |
| Ice 3.1.1 core dump while invoke on replica | sinofool | Help Center | 8 | 11-06-2006 10:32 AM |
| Patch of IceGrid replica-group type None | sinofool | Help Center | 2 | 10-31-2006 06:49 AM |