This forum has been archived. Please start a new discussion on GitHub.

Find object on least loaded node with threshold

Is it currently possible to find an object by type on the least loaded node, but only if the load is under a certain threshold? The only way I can see to accomplish this is to write my own locator implementation, unless there is a way to determine the name of the node that an object proxy is running on.

Any info is appreciated.

BTW, Ice is a really great system. I have been enjoying it immensely.


  • benoit
    benoit Rennes, France

    No, there's no way to specify a threshold, you can only retrieve an object by type on the least loaded node.

    You could figure out the node which host the object's server using the adapter ID from the proxy returned by one of the findObject method of the IceGrid::Query interface. However, this requires to create an administrative session to retrieve the deployment information of your application (to then lookup for the adapter ID).

    Another possibility would be to embed the node name in the adapter ID by explicitly specifying the adapter IDs in your deployment descriptors (using the "id" attribute of the <adapter> element) but doing this might not be a good idea if you want to relocate a given server on another node at some point.