How to get endpoints from locator table in client?

in Help Center
I trace the locator info get from the IceGrid:
-- 15-7-28 15:13:27:510 Client: Locator: searching for object by id
object = feidao/testService
-- 15-7-28 15:13:27:542 Client: Locator: searching for adapter by id
adapter = testService
-- 15-7-28 15:13:27:579 Client: Locator: retrieved endpoints from locator, adding to locator table
adapter = testService
endpoints = tcp -h 192.168.2.103 -p 59689 -t 60000:tcp -h 192.168.2.103 -p 59703 -t 60000:tcp -h 192.168.2.103 -p 59696 -t 60000
Now I want to get these endpoints info. I don't want to choose them in Ramdon or Ordered.
I think i can get them by [ proxy.ice_getEndpoints() ], but there is no info.
both client and server are in Java.
thanks.
-- 15-7-28 15:13:27:510 Client: Locator: searching for object by id
object = feidao/testService
-- 15-7-28 15:13:27:542 Client: Locator: searching for adapter by id
adapter = testService
-- 15-7-28 15:13:27:579 Client: Locator: retrieved endpoints from locator, adding to locator table
adapter = testService
endpoints = tcp -h 192.168.2.103 -p 59689 -t 60000:tcp -h 192.168.2.103 -p 59703 -t 60000:tcp -h 192.168.2.103 -p 59696 -t 60000
Now I want to get these endpoints info. I don't want to choose them in Ramdon or Ordered.
I think i can get them by [ proxy.ice_getEndpoints() ], but there is no info.
both client and server are in Java.
thanks.
0
Comments
I have did it ,but in this way ,I can't get the full locator info ,cause it choose endpoints in Ramdom or Ordered to create the connetion.
MessageEndpointPrx proxy= MessageEndpointPrxHelper.checkedCast(communicator().stringToProxy("feidao/testService").ice_connectionId(ramdom));
proxy.ice_getConnection().getEndpoint()
in this way ,i just get one endpoint in ramdom one time.
I want to get the full locator info ,and make a custom client load balancing.
An indirect proxy such as "feidao/testService" has indeed no endpoints so calling ice_getEndpoints() on such a proxy will always return an empty list of endpoints. As José indicated, you need to resolve manually the endpoints by calling on the locator directly.
For a well-known proxy, you can use:
You can also use the IceGrid::Query interface to retrieve the proxies of each replica, see https://doc.zeroc.com/display/Ice36/...ObjectReplicas for more information on this.
That being said, I'm curious as to why you need to do this in the client. What strategy do you need for sorting the replicas?
Note also that Ice 3.6 now provides a way to implement custom load balancing with an IceGrid plugin. Did you consider using this instead? See https://doc.zeroc.com/display/Ice36/...cingStrategies for more information on custom load balancing.
Cheers,
Benoit.
the real client may be a high parallel webserver. and after the enterance service may be a heavy task.
but the IceGrid load balancing only works at the client call the locate service, or I use [ .ice_connectionId(ramdom)) ] in ramdom selection without cache.
so i try to make a load balancing in client.