brokerId is assigned as below:(code)
String brokerId = _brokerConf.getProperty(Broker.CONFIG_OF_BROKER_ID, getDefaultBrokerId());
A valid value for brokerId is important in many components, for example it's required in v2 engine to guarantee an unique requestId. It's preferred to throw an exception to stop broker starter instead of return an empty string.
private String getDefaultBrokerId() {
try {
return InetAddress.getLocalHost().getHostName();
} catch (Exception e) {
LOGGER.error("Caught exception while getting default broker Id", e);
return "";
}
}
cc @jackjlli