Home Help Center

How to instantiate an ICE Object redundantly?

vsonnathivsonnathi Member Venkat RamanaOrganization: Amazon.comProject: Prototype ✭✭
Hi,

I read the following in the documentation and could find any references to it later in the document

"A single Ice object can be instantiated in a single server or, redundantly, in
multiple servers. If an object has multiple simultaneous instantiations, it is still
a single Ice object."

Can someone please point or give some info on how to do this?

Thanks,
--Venkat.

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    It's really quite simple:
    • Two or more servers create a servant with the same identity
    • The proxy for the Ice object contains the endpoints for all of the servers
    • The client selects one of the endpoints at random when establishing a connection
    • In the case of a network error, the client automatically retries all of the endpoints when attempting to reestablish a connection
    Take care,
    - Mark
  • vsonnathivsonnathi Member Venkat RamanaOrganization: Amazon.comProject: Prototype ✭✭
    Hi,

    Thanks for the info.

    I have to maintain a cache (Search Engine results) for the service and would like to go to the same server for further requests for efficiency purposes. Can we do this with ICE - what I am looking for is for the first request go to a available server and from then on try going to the same server if available.

    Thanks,
    --Venkat.
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    Once established, Ice will continue to use a connection for subsequent requests. However, Ice may transparently close and reopen connections, and that could result in a new connection to a different server.

    One way to implement your requirement is with a two-tiered system: the client uses a multi-endpoint proxy to send a request to a randomly-selected factory, and the factory returns a proxy for an object in a particular server (a "session" concept).

    Take care,
    - Mark
  • ganzuoniganzuoni Member Guido AnzuoniOrganization: IndividualProject: No specific project ✭✭
    Originally posted by mes
    Hi,

    Once established, Ice will continue to use a connection for subsequent requests. However, Ice may transparently close and reopen connections, and that could result in a new connection to a different server.

    One way to implement your requirement is with a two-tiered system: the client uses a multi-endpoint proxy to send a request to a randomly-selected factory, and the factory returns a proxy for an object in a particular server (a "session" concept).

    Take care,
    - Mark


    Hi Marc,
    it could be nice (i.e. transparent) if all the job could be done by a
    Locator implementation.
    This special Locator, for each findObjectById, could return a proxy obtained
    merging the endpoints (in randomized order, round-robin ?)
    of registered replicas.
    Obviously, client-side Ice internal should not alter the order of
    endpoints received by the Locator.
    More, LocatorInfo should not cache endpoints. This is particularly
    important in multi-threaded client such as servlet container.
    In this way, the endpoint list attached to a reference is used
    just for failover purposes and not for load-balancing, that is left
    to the Locator.

    But, maybe, I am missing a lot of other issues concerning connection
    management....

    Guido.
Sign In or Register to comment.