Archived

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

IceStorm Glacier2 Question

I have an application that uses a very slow link. I want to to have a remote IceStorm feed a local server which I want to publish to a local IceStorm. The Remote IceStorm is accesses via a Glacier2 router. I know that if I am accessing a local server I can set the Router="" to disable the Default Router and get the local application to use the loal server. Now how does this work for IceStorms? I tried the folllowing to no avail with icestormadmin:
Ice.Default.Router=TestRouter/router:default -p 14000 -h 10.3.0.74

IceStorm.TopicManager.Proxy=LocalFeed/TopicManager:default -p 10000
IceStorm.TopicManager.Router=""



With the Router statements commented out and I run icestormadmin --Ice.Config=file -e topics, I get the topics. With the Router statements in the file I get an error. TestRouter Exists and I am connecting to it via another server.

What do I need to do to do this?

Comments

  • bernard
    bernard Jupiter, FL
    Hi Tim,

    Your setup and problem are not clear to me.

    You have a remote IceStorm server, with a remote Glacier2 router on the same LAN? And then you have a local server that subscribes to some topic on this remote IceStorm server, and then publishes events on a local IceStorm server?

    What are you trying to achieve with icestormadmin? Just talk to the remote IceStorm server?

    Best regards,
    Bernard
  • bernard wrote: »
    Hi Tim,

    Your setup and problem are not clear to me.

    You have a remote IceStorm server, with a remote Glacier2 router on the same LAN? And then you have a local server that subscribes to some topic on this remote IceStorm server, and then publishes events on a local IceStorm server?


    I want to have this type of setup. I want to send a topic from a remote IceStorm with a Glacier2 router to a local server and then run a calulcation and send out a different topic to the local IceStorm. I want to know how to do that either through a configuration file or C++ code.

    Thanks in advance!
  • bernard
    bernard Jupiter, FL
    Hi Tim,

    When you set Ice.Default.Router, all the proxies created in your client get by default this router. For example if you retrieve a topic from the local feed topic manager, the topic proxy will be routed -- even if the topic manager proxy you used isn't.

    icestormadmin doesn't change the router of the proxies it gets, and this is why your configuration (with a default router and local non-routed topic manager) can't work for icestormadmin.

    In your own server (an IceStorm subscriber and publisher), it could be simpler and clearer not to use a default router at all, and explicitly set router on the proxies that need it, such as topic proxies retrieved from the remote IceStorm server.
    Also, since you subscribe to topics through Glacier2, your subscribers are "callbacks" for Glacier2, so you need to set their category properly. See the Glacier2 chapter for details.

    Best regards,
    Bernard
  • Thanks for the reply Bernard.

    I would like to keep the Default Router because I have other services the local server uses. I also have an IceGrid behind the Glacier2 router, so I would think that I would want to keep the default router. I have been able to get a proxy to the LocalFeed ( the Local IceStorm ), but I am not able to publish. It sounds to be like the topic manger is still routing. I see on the local IceStorm a routed remote address. Currently I am setting the local TopicManager's router to 0 and the publisher's router to 0.
    IceStorm::TopicManagerPrx localMgr;
    
            try
            {
                  Ice::ObjectPrx base = communicator()->propertyToProxy("IceStorm.TopicManager.Proxy");
                    base = base->ice_router(0);
                    localMgr = IceStorm::TopicManagerPrx::checkedCast( base );
            }
            catch(...)
            {
                    cerr << appName() << ": local feed invalid proxy catch" << endl;
                    return EXIT_FAILURE;
    }
    

    And
    IceStorm::TopicPrx topic;
            try
            {
                    topic = localMgr->retrieve("theos");
            }
            catch(const IceStorm::NoSuchTopic&)
            {
                    try
                    {
                            topic = localMgr->create("theos");
                    }
                    catch(const IceStorm::TopicExists&)
                    {
                            cerr << appName() << ": temporary failure. try again." << endl;
                            return EXIT_FAILURE;
                    }
            }
    
            Ice::ObjectPrx publisher = topic->getPublisher();
            publisher = publisher->ice_router(0);
    
            rtprx = ::TVS::RealTimeFeedPrx::uncheckedCast(publisher);
    
  • bernard
    bernard Jupiter, FL
    Hi Tim,

    Could you try with one more ->ice_router(0) after the checkedCast?
    localMgr = IceStorm::TopicManagerPrx::uncheckedCast(localMgr->ice_router(0));
    

    Please let me know if this fixes the problem!

    Cheers,
    Bernard
  • bernard
    bernard Jupiter, FL
    Also, this won't work:
        Ice::ObjectPrx publisher = topic->getPublisher();
    

    since at this point your topic proxy is routed.

    Cheers,
    Bernard
  • Now that I know that I cannot use a default router, I am at a loss to figure out to connect to my remote IceGrid without a default router?

    I tried to set Ice.Default.Locator.Router=IRouter..., but that is not correct.

    If I want to have my app connect to the IceStorm via the IceGrid, what is the way to get that to happen? In Issue 23 of Connections, the Proxy article states that routed connections are made by either setting the default router or using ice_router. I get that, but how do I get the original router for my app to route with.
  • bernard
    bernard Jupiter, FL
    Hi Tim,

    With Ice, routing occurs before indirect-proxy resolution, so if you have a proxy with both a router and a locator, the locator isn't used. For indirect proxies, it's the Glacier2 router that performs the indirect proxy resolution using its own locator, configured using Ice.Default.Locator.

    Given this, I don't see the use-case for using an IceGrid registry on-the-other-side of a Glacier2 router as your default locator. Sure, Ice.Default.Locator.Router = ... should work, but then which indirect proxies are you going to resolve? Proxies to objects on your LAN, using this remote IceGrid registry on a different LAN?

    Cheers,
    Bernard
  • Hi Bernard


    Thanks for your time and answers.


    The remote network is on a different LAN. What I tried just now is setting the default router from the configuration file and then when I wanted to use the local LAN, I set the default router to 0. After I finished with the local LAN, I reset the default router to its original value. This seems to work in my system. Is this a valid way of doing it?


    Also I should mention that the IceGrid runs on Linux and the client stuff is on a Windows Tablet.

    Tim
  • bernard
    bernard Jupiter, FL
    Hi Tim,

    Yes, changing/clearing/setting the default router in your application is a valid and legitimate approach.

    Naturally, changing the default router (or any other default setting) only affects the proxies created after this change.

    Cheers,
    Bernard