Archived

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

Question of forwarding ObjectPrx in Servant Locator

Hi :

As I know that ICE haven't the ForwardRequest Exception. What can I do if I want to forward the ObjectPrx to the client in the Servant Locator??? Does ICE have somethings method like ForwardRequest in CORBA??? THANKS!!!!!!:)

Comments

  • benoit
    benoit Rennes, France
    Hi,

    There's no ForwardRequest mechanism in Ice. It's difficult to give some advises without a little more details on what you're trying to do. Could you detail a little more your application?

    Cheers,
    Benoit.
  • what i want to do is :
    When the server is busy, I would like to redirect the others server object proxy by the servant locator for the new coming clients. But in ICE, it haven't ForwardRequest, it can't redirect others object proxy to the client. I would like to find a method to redirect the object proxy to client. Thanks:)
  • CORBA's LocationForward reply is problematic. For one, it requires explicit support at the protocol level, even though this is not necessary. (As IceGrid demonstrates, normal remote invocations can be used to achieve the same thing more cleanly.) Secondly, LocationForward limits object migration: in CORBA, each indirect IOR has the endpoint information of the locator hard-wired, so it is impossible to change the location service's location without breaking existing object references, and it is effectively impossible to migrate objects across location domain boundaries without breaking existing references.

    In addition, LocationForward is inefficient, no matter what the client does: during binding, the client can either always first send a LocateRequest, in which case it redundantly sends a message every time it binds a direct reference, or it can send the request itself, in which case it redundantly invokes an operation (and transmits the operation's parameters) every time it binds an indirect reference.

    For these reasons, the Ice protocol does not have a LocationForward message.

    To do what you want, I would add a RedirectException to the operations that need to redirect clients and handle the exception in a dispatch layer in the client.

    Cheers,

    Michi.
  • is it add the RedirectException in the slice code like ?

    exception RedirectExecption {
    //Handle the redirect in here
    };
    interface Demo {
    void Printer(string s) throws RedirectException;
    };

    Thanks !!!!
  • kongchoy wrote:
    is it add the RedirectException in the slice code like ?

    exception RedirectExecption {
    //Handle the redirect in here
    };

    Yes, that's the general idea. Depending on where in the system the decision is made as to where to redirect to, you could also add the proxy to the new target as a member of the exception. On the other hand, the server that redirects might not know where to redirect the client to, in which case the client has to come up with the new proxy somehow.

    Cheers,

    Michi.
  • Thanks!

    Thank You Very Much !!!!!:D