Archived

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

Routing of request

Hello,

I have some machines running in a local network and one, and only one of they, take the role of the active server of the network at a precise moment. This server role is dynamic, all machines can be servers but only one at the same time.

In each on this machines, some client processes must connect to the dynamic server whithout the knowledge of the endpoints of the Object Adapters at the server machine.
The IcePack service can't help here because this configuration is dynamic, it changes at runtime.

I think one solution is a local service running in all machines, that know the exact location of the dynamic server at runtime. This local service can listen at 127.0.0.1 to the request of the client processes and forward this request to the dynamic server and, of course, return the server's response to the corresponding client.

What is your advice with this situation? Maybe something close to the Glacier service?

Thanks and best regards,
Mario.

Comments

  • marc
    marc Florida
    You could write a router that forwards requests from the clients to the server as blobs. Note that I don't mean a full implementation of the Ice::Router interface (such as Glacier), but simply a process that forwards requests, similar to IceStorm.

    Such router could listen to a fixed port on the loopback interface, and forward all requests to a server that is configured by whatever means are appropriate for your application. Your server would then use the loopback address and the chosen port for it's published endpoints, so that if the server returns a proxy to the client as a result of an operation call, such proxy would point to the router instead of to the server directly.

    Yet another solution would be to implement the Ice::Locator interface, i.e., to write a custom locator service similar to IcePack. This would be the cleanest solution, but it would be more work than the simple router.
  • Thanks marc :)

    I'm going to read "32.3.2 Dynamic Dispatch using Blobject" of the Ice tutorial following your advice.

    Best regards,
    Mario.