ice
ice copied to clipboard
Simplify IceGrid instance name computation
We currently have a complicated process for determining the IceGrid instance name:
// The IceGrid instance name. We can't use getIceProperty as we don't want to get any default values.
string instanceName = properties->getProperty("IceGrid.InstanceName");
if (instanceName.empty())
{
instanceName = properties->getProperty("IceLocatorDiscovery.InstanceName");
}
if (instanceName.empty())
{
instanceName = communicator()->getDefaultLocator()->ice_getIdentity().category;
}
if (instanceName.empty())
{
instanceName = "IceGrid";
}
I've yet to find anywhere that we document this in the docs. I think we should just use IceGrid.InstanceName
We rely on the Ice.Default.Locator -derived instance name for the config files we ship, so we can't change this logic.
https://github.com/zeroc-ice/ice/blob/main/cpp/config/icegridnode.cfg
We should however fix the doc.
Added description for default in IceGrid.InstanceName.