SuperTenantCarbonContext.startTenantFlow();
int tenantId = SuperTenantCarbonContext.getCurrentContext(StatisticsServiceComponent.getConfigurationContext()).getTenantId();
SuperTenantCarbonContext.getCurrentContext().setTenantId(tenantId);
SuperTenantCarbonContext.getCurrentContext().getTenantDomain(true);
broker.publishRobust(message, ServiceStatisticsPublisherConstants.BAM_REG_PATH);
} catch (EventBrokerException e) {
log.error("Can not publish the message ", e);
} finally {
SuperTenantCarbonContext.endTenantFlow();