Archived

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

IceStorm tracing

I added:

IceStorm.Trace.Topic=2
IceStorm.Trace.TopicManager=1
IceStorm.Trace.Subscriber=1

to the config file I pass to icebox.

Is this the correct way to do this? I don't get any additional output from the icebox service...

Comments

  • mes
    mes California
    Hi Mark,

    IceBox by default creates a new communicator instance for each service, therefore the configuration properties you define for IceBox are not seen by IceStorm.

    In our IceStorm example (demo/IceStorm/clock), we use 'config_service' as the configuration file for IceBox. If you look at the file, you'll notice this line:
    IceBox.Service.IceStorm=IceStormService,21:create --Ice.Config=config
    
    This causes IceStorm to load its configuration from the file named 'config'.

    You can use a similar approach to define your tracing properties, or you can define them as trailing arguments in the IceBox.Service.IceStorm property, similar to --Ice.Config above.

    BTW, you can enclose code in [ code ] my code here [ /code ] (without the spaces around the brackets) and it will preserve formatting.

    Take care,
    - Mark
  • Okay, I did this, but I get no IceStorm tracing, only network tracing. Here is my traceConfig file:

    [ code ]
    IceStorm.Trace.TopicManager=1
    IceStorm.Trace.Topic=2
    IceStorm.Trace.Subscriber=1
    [ /code ]

    And here is my icebox config file:

    [ code ]
    Ice.Trace.Network=3

    IceBox.Service.MSCEventService=IceStormService,21:create --Ice.Config=traceConfig
    Freeze.DbEnv.MSCEventService.DbHome=MSCdb
    MSCEventService.TopicManager.Endpoints=tcp -h cactus -p 9999
    MSCEventService.Publish.Endpoints=tcp
    [ /code ]
  • mes
    mes California
    Hi,

    Your tracing properties should use the same name as the IceBox service:

    MSCEventService.Trace.TopicManager=1
    MSCEventService.Trace.Topic=2
    MSCEventService.Trace.Subscriber=1

    We'll make a note of this in the manual.

    Take care,
    - Mark
  • Ah! Okay, that works. As far as I can tell, I've done everything right, but I still get:

    [ icebox-MSCEventService: TopicManager: loading topic "ActuatorControl" from database ]

    [ icebox-MSCEventService: Topic: Subscribe: 316F86F9-26C0-4507-9C84-A62E91CFB104 QoS: ]

    [ icebox-MSCEventService: Subscriber: 316F86F9-26C0-4507-9C84-A62E91CFB104: publish failed: Reference.cpp:1103: Ice::NoEndpointException:
    no suitable endpoint available for proxy `316F86F9-26C0-4507-9C84-A62E91CFB104 -o' ]


    Here is the subscriber code:

    [ code ]
    virtual int run(int argc, char **argv)
    {
    //
    // Set up for IceStorm.
    //
    Ice::ObjectPrx base = communicator()->stringToProxy(
    "MSCEventService/TopicManager:tcp -h cactus -p 9999");

    IceStorm::TopicManagerPrx topicManager =
    IceStorm::TopicManagerPrx::checkedCast(base);

    if ( !topicManager )
    printf("No Topic Manager proxy!\n");
    else
    printf("Got Topic Manager proxy.\n");

    Ice::ObjectAdapterPtr adapter =
    communicator()->createObjectAdapter("MonitorAdapter");

    Ice::ObjectPtr monitor = new MonitorI;

    Ice::ObjectPrx proxy = adapter->addWithUUID(monitor);
    if ( !proxy )
    printf("Monitor Proxy creation failed\n");
    else
    printf("Monitor Proxy creation succeeded\n");

    IceStorm::TopicPrx topic;
    IceStorm::QoS qos;
    try
    {
    topic = topicManager->retrieve("ActuatorControl");
    topic->subscribe(qos, proxy);
    }
    catch (const IceStorm::NoSuchTopic& ex)
    {
    std::cerr << "No topic found" << std::endl;
    return 0;
    }

    adapter->activate();

    printf("waitForShutdown\n");
    communicator()->waitForShutdown();

    return 0;
    }

    [ /code ]

    I'm sure this is simple, I just don't see it...
  • mes
    mes California
    The NoEndpointException indicates that the subscriber proxy doesn't contain any endpoints. Does your subscriber define the property MonitorAdapter.Endpoints?

    BTW, you need to remove the whitespace inside "[ code ]" for the tags to work properly.

    Take care,
    - Mark
  • Sigh. I knew it was something simple... Thanks!
  • mes
    mes California
    me wrote:
    IceBox by default creates a new communicator instance for each service, therefore the configuration properties you define for IceBox are not seen by IceStorm.
    I was mistaken when I wrote this. It is possible to define your IceStorm properties in the IceBox configuration file.

    - Mark