How to verify IceBoxNet is up and running?

HurlymurphyHurlymurphy Aldo PlatzOrganization: Schindler Elevator Project: TestToolsMember

We use IceBoxNet for managing our custom .net services. We start IceBoxNet by Process.Start() within our code and afterwards try to get the ServiceManager. Depending on timing behavior of the start() methods of our custom services which are started by the IceBox, we are not able to get the proxy for the ServiceManager at first attempt. Only after several retries we finally success.

Is there a possibility to check when the IceBox is up and running, so we don't have to implement a retry mechanism?

Btw: Is it possible to launch IceBox without starting the hosted services automatically?

Best Answer

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Accepted Answer

    Hi,

    Monitoring the process standard output and waiting the ready message to be printed out for IceBox servers started with --Icebox.PrintServicesReady is indeed a good solution.

    Another option would be to use IceDiscovery and configure it to lookup for the service manager object for as long as you need. For example you can try the following:

    > iceboxnet.exe --Ice.Plugin.IceDiscovery=IceDiscovery:IceDiscovery.PluginFactory \
                               --Ice.Admin.InstanceName=IceBox1 \
                               --Ice.Admin.Endpoints="tcp -h localhost" \
                               --Ice.Admin.AdapterId=IceBox1-AdminAdapter
    
    > iceboxadmin --Ice.Plugin.IceDiscovery=IceDiscovery:IceDiscovery.PluginFactory \
                             --IceDiscovery.RetryCount=20 \
                             --IceDiscovery.Timeout=1000 \
                             --IceBoxAdmin.ServiceManager.Proxy="icebox/admin -f [email protected]" \
                             stop MyService
    

    Here, the icebox admin process will wait for up to 20 seconds for the ServiceManager facet.

    Cheers,
    Benoit.

Answers

  • janosjanos GermanyJanos VeresOrganization: feat.Me Networks, Inc.Project: An offline social interaction platform.Member
    edited November 2016

    Hi,

    my approach would be to make it more event driven and wait for a signal from IceBoxNet. This out-of-the-box should do the trick:
    https://doc.zeroc.com/pages/viewpage.action?pageId=16716657#IceBox.*-IceBox.PrintServicesReady

    However I haven't tried it, it seems to only get fired when all services have been started. If you have no automatically starting services, I'd create one, which can deliver lifecycle information to third parties waiting. This could be done via distributing signals either via ICE, by creating a file or writing state to a database, whichever rocks your boat.

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Accepted Answer

    Hi,

    Monitoring the process standard output and waiting the ready message to be printed out for IceBox servers started with --Icebox.PrintServicesReady is indeed a good solution.

    Another option would be to use IceDiscovery and configure it to lookup for the service manager object for as long as you need. For example you can try the following:

    > iceboxnet.exe --Ice.Plugin.IceDiscovery=IceDiscovery:IceDiscovery.PluginFactory \
                               --Ice.Admin.InstanceName=IceBox1 \
                               --Ice.Admin.Endpoints="tcp -h localhost" \
                               --Ice.Admin.AdapterId=IceBox1-AdminAdapter
    
    > iceboxadmin --Ice.Plugin.IceDiscovery=IceDiscovery:IceDiscovery.PluginFactory \
                             --IceDiscovery.RetryCount=20 \
                             --IceDiscovery.Timeout=1000 \
                             --IceBoxAdmin.ServiceManager.Proxy="icebox/admin -f [email protected]" \
                             stop MyService
    

    Here, the icebox admin process will wait for up to 20 seconds for the ServiceManager facet.

    Cheers,
    Benoit.

Sign In or Register to comment.