Icestorm example or tutorial...

krisjakobsenkrisjakobsen Kristoffer JakobsenOrganization: Engineering College of AarhusProject: An industrial machine with object oriented commMember
Hey...

I am quite new to ICE, so i have some problems getting the communication up.

Ice Storm is quite hard to get up and running. When i am debugging the demo example it fails with a connection refused. After some reading am i totally lost in IceBox, Icegrid and IceStorm. What is a demand for getting the Storm up and running?

My goal is to make a server in CPP, there publish logs through IceStorm. The subscriber is a C# application on another host. Getting the logs and persists them in a DB.

Is there an example og tutorial on how to get IceStorm up and working? and is IceStorm the right chiose to solce this issue?

Kind Regards
Kristoffer

Comments

  • chowchow Brian ChojnowskiOrganization: ATTProject: ACD event publisher 3rd party call control serverMember
    Do you have icestorm running while you are debugging you application? If memory serves me correctly, your server app registers a topic and then posts messages to that topic. Your clients register for that topic and then the posts arrive at a callback function in your client. However the sever app is not managing the topic and broadcasts to clients. That is the job of the icestorm application which I think runs in icebox. Open another cmd window (assuming you are running this on windows) and do something like :
    icebox --Ice.Config=config.icestorm
    you might find the config file in the demo directory. I think also the readme text file in the icestorm demo folder says how to launch icestorm.
    The n once the icestorm server is running, launch or debug your app.
  • krisjakobsenkrisjakobsen Kristoffer JakobsenOrganization: Engineering College of AarhusProject: An industrial machine with object oriented commMember
    Hey Chow

    I am sure your memory is fine, because the Icestorm should run before the wanted application.

    But how? there is no *.icestorm file, the only file i have is config.service, config.icebox and config.sub. And there is not a word on how to run the IceStorm in the readme.

    Kind Regards
    Kristoffer
  • chowchow Brian ChojnowskiOrganization: ATTProject: ACD event publisher 3rd party call control serverMember
    I don't remember where I found this example to work from but this is what I use for one of my apps. There are 2 files involved and the command to run to start icebox using this particular set of files is:

    icebox --Ice.Config=config.icestorm.icebox

    file: config.icestorm.icebox=============================
    #
    # The IceBox server endpoint configuration
    #
    IceBox.ServiceManager.Endpoints=tcp -p 9998

    #
    # The IceStorm service
    #
    IceBox.Service.IceStorm=IceStormService,33:createIceStorm --Ice.Config=config.icestorm.service

    #
    # Warn about connection exceptions
    #
    Ice.Warn.Connections=1

    #
    # Network Tracing
    #
    # 0 = no network tracing
    # 1 = trace connection establishment and closure
    # 2 = like 1, but more detailed
    # 3 = like 2, but also trace data transfer
    #
    Ice.Trace.Network=3

    #
    # Protocol Tracing
    #
    # 0 = no protocol tracing
    # 1 = trace protocol messages
    #
    Ice.RetryIntervals=0 500 1800
    Ice.Trace.Protocol=1


    file config.icestorm.service=================================
    #
    # The IceStorm service instance name.
    #
    IceStorm.InstanceName=VineIceStorm

    #
    # This property defines the endpoints on which the IceStorm
    # TopicManager listens.
    #
    IceStorm.TopicManager.Endpoints=tcp -p 11001

    #
    # This property defines the endpoints on which the topic
    # publisher objects listen. If you want to federate
    # IceStorm instances this must run on a fixed port (or use
    # IceGrid).
    #
    IceStorm.Publish.Endpoints=tcp -p 11002

    #
    # TopicManager Tracing
    #
    # 0 = no tracing
    # 1 = trace topic creation, subscription, unsubscription
    # 2 = like 1, but with more detailed subscription information
    #
    IceStorm.Trace.TopicManager=2

    #
    # Topic Tracing
    #
    # 0 = no tracing
    # 1 = trace unsubscription diagnostics
    #
    IceStorm.Trace.Topic=1

    #
    # Subscriber Tracing
    #
    # 0 = no tracing
    # 1 = subscriber diagnostics (subscription, unsubscription, event
    # propagation failures)
    #
    IceStorm.Trace.Subscriber=1

    #
    # Amount of time in milliseconds between flushes for batch mode
    # transfer. The minimum allowable value is 100ms.
    #
    IceStorm.Flush.Timeout=2000

    #
    # Network Tracing
    #
    # 0 = no network tracing
    # 1 = trace connection establishment and closure
    # 2 = like 1, but more detailed
    # 3 = like 2, but also trace data transfer
    #
    Ice.Trace.Network=3
    Ice.RetryIntervals=0 500 1800
    IceStorm.Discard.Interval=15
    IceStorm.Send.Timeout=-1

    #
    # This property defines the home directory of the Freeze
    # database environment for the IceStorm service.
    #
    Freeze.DbEnv.IceStorm.DbHome=IceStorm

    # This property is used by the administrative client to connect to IceStorm.
    #
    # IceStorm.TopicManager.Proxy=VineIceStorm/TopicManager:default -p 10001
  • chowchow Brian ChojnowskiOrganization: ATTProject: ACD event publisher 3rd party call control serverMember
    Also, icestorm uses a database to keep track of things and where ever you launch icestorm, you need a subdirectory that matches:

    Freeze.DbEnv.IceStorm.DbHome=IceStorm

    In this case, lets say you ran icestorm from c:\temp you would need to make sure the forlder c:\temp\IceStorm exists before launching icestorm.


    Also, any reference to the word Vine is specific to my application, change it to match your application.
  • krisjakobsenkrisjakobsen Kristoffer JakobsenOrganization: Engineering College of AarhusProject: An industrial machine with object oriented commMember
    a thousand thanks for the help Chow, i have it up and running. THANKS.

    And to Zeroc, i am very sorry i was blind today and could not see the third line in the readme. Where the command for running the IceStorm server stands. In my search for this line, i missed a description of the relationship between IceStorm and the other ice components it is using.

    But back to my first question, is Icestorm the right chiose in this case? Or should I look for another solution?

    Kind Regards
    Kristoffer
  • matthewmatthew NL, CanadaMatthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications EngineMember ✭✭✭
    My goal is to make a server in CPP, there publish logs through IceStorm. The subscriber is a C# application on another host. Getting the logs and persists them in a DB.

    IceStorm is used to distribute messages between publishers and subscribers, where the publishers are fully isolated from the subscribers. Does your architecture have multiple publishers? If not (and it looks that way from your description), then it sounds like IceStorm is not the best solution for you.
  • krisjakobsenkrisjakobsen Kristoffer JakobsenOrganization: Engineering College of AarhusProject: An industrial machine with object oriented commMember
    Hi Matthew

    No we do not have multiple publishers. Here is the issues the solution hopefully should take care of:
    • Server must send log messages to a client
    • It could be nice if a test application, can listen live on the logs on runtime
    • maybe in the future there can come more than one client
    • Log messages is specialized from one root log class
    • It could be nice if the connection as secure for loosing data as possible, not like crypted but not loosing logs.
    • maybe in late future there can come upto 4 publishers, but not in the nearest future

    Does anyone have an idea, for what will be the best way to make this communication work?

    Kind Regards
    Kristoffer
  • matthewmatthew NL, CanadaMatthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications EngineMember ✭✭✭
    This seems quite straightforward. Something like this slice would work:
    class LogMessage { // whatever you need
    };
    
    interface LogObserver {
      void logged(LogMessage message);
    };
    
    interface Logger {
       void log(LogMessage message);
       void addObserve(LogObserver* observer);
       void removeObserver(LogObserver* observer);
    };
    

    You can implement addObserver/removeObserver using IceStorm in the Logger implementation.
  • krisjakobsenkrisjakobsen Kristoffer JakobsenOrganization: Engineering College of AarhusProject: An industrial machine with object oriented commMember
    Hi Matthew

    I think I will go after this more simple architecture, thanks.

    What do you mean by this:
    You can implement addObserver/removeObserver using IceStorm in the Logger implementation.

    Kind Regards
    Kristoffer
  • matthewmatthew NL, CanadaMatthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications EngineMember ✭✭✭
    I mean the internal implementation of the server can use IceStorm to distribute the events. Look at how the chat demo is written in the newsletter articles, or perhaps at demo/IceStorm/counter. Both of these use IceStorm in the server implementation, and the client is not aware of IceStorm at all.
  • krisjakobsenkrisjakobsen Kristoffer JakobsenOrganization: Engineering College of AarhusProject: An industrial machine with object oriented commMember
    Hi Matthew

    Thanks for the reply. I will look at the examples...

    Cheers,
    Kristoffer
Sign In or Register to comment.