Results 1 to 11 of 11

Thread: IceStorm Glacier2 Question

  1. #1
    bigtim is offline Registered User
    Name: Tim Brandt
    Organization: KC-Co II
    Project: Trading Applications
    Join Date
    Feb 2006
    Posts
    35

    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:

    Code:
    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?
    Tim Brandt
    KC-CO II, LLC
    Trading Applications

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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 Normier
    ZeroC, Inc.

  3. #3
    bigtim is offline Registered User
    Name: Tim Brandt
    Organization: KC-Co II
    Project: Trading Applications
    Join Date
    Feb 2006
    Posts
    35
    Quote Originally Posted by bernard View Post
    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!
    Tim Brandt
    KC-CO II, LLC
    Trading Applications

  4. #4
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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
    Bernard Normier
    ZeroC, Inc.

  5. #5
    bigtim is offline Registered User
    Name: Tim Brandt
    Organization: KC-Co II
    Project: Trading Applications
    Join Date
    Feb 2006
    Posts
    35
    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.

    Code:
     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

    Code:
    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);
    Tim Brandt
    KC-CO II, LLC
    Trading Applications

  6. #6
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Tim,

    Could you try with one more ->ice_router(0) after the checkedCast?

    Code:
    localMgr = IceStorm::TopicManagerPrx::uncheckedCast(localMgr->ice_router(0));
    Please let me know if this fixes the problem!

    Cheers,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  7. #7
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Also, this won't work:

    Code:
        Ice::ObjectPrx publisher = topic->getPublisher();
    since at this point your topic proxy is routed.

    Cheers,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  8. #8
    bigtim is offline Registered User
    Name: Tim Brandt
    Organization: KC-Co II
    Project: Trading Applications
    Join Date
    Feb 2006
    Posts
    35
    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.
    Tim Brandt
    KC-CO II, LLC
    Trading Applications

  9. #9
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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
    Bernard Normier
    ZeroC, Inc.

  10. #10
    bigtim is offline Registered User
    Name: Tim Brandt
    Organization: KC-Co II
    Project: Trading Applications
    Join Date
    Feb 2006
    Posts
    35
    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
    Last edited by bigtim; 11-05-2007 at 02:58 PM.
    Tim Brandt
    KC-CO II, LLC
    Trading Applications

  11. #11
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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
    Bernard Normier
    ZeroC, Inc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IceStorm with Glacier2
    By phil++ in forum Help Center
    Replies: 7
    Last Post: 09-17-2008, 12:27 PM
  2. Question about Glacier2
    By shoulder in forum Help Center
    Replies: 5
    Last Post: 07-03-2008, 08:09 AM
  3. IceStorm & Glacier2
    By xdm in forum Help Center
    Replies: 2
    Last Post: 11-14-2006, 10:05 AM
  4. Question about Glacier2
    By davidcr1983 in forum Help Center
    Replies: 2
    Last Post: 08-10-2006, 04:13 PM
  5. Question about Glacier2!
    By JaneShang in forum Help Center
    Replies: 2
    Last Post: 06-16-2005, 02:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •