Archived

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

How to get current IceGrid node and server name within IceBox.Service.start?

Hi!

What is most correct way to get current IceGrid node and server name within IceBox.Service.start implementation?

I want to know this to debug my distributed application.

Thanks.

Comments

  • benoit
    benoit Rennes, France
    Hi,

    If you're using the XML deployment mechanism you can set properties with this information in the IceBox service descriptor:
         <service ...>
            <properties>
              <property name="NodeName"    value="${node}"/>
              <property name="ServerName"  value="${server}"/>
              <property name="ServiceName" value="${service}"/>
            </properties>
         </service>    
    

    You can then retrieve these properties with the service communicator properties (see Ice::Communicator::getProperties()).

    Cheers,
    Benoit.
  • Benoit! Many thanks!