class MessagingPlatformConfiguration {

    public String getHostname() {
        if (StringUtils.isEmpty(hostname)) {
            try {
                hostname = systemInfoProvider.getHostName();
                if (!StringUtils.isEmpty(domain) && hostname.endsWith("." + domain)) {
                    hostname = hostname.substring(0, hostname.length() - domain.length() - 1);
                }
            } catch (UnknownHostException e) {
                logger.warn("Could not determine hostname from inet address: {}", e.getMessage());
            }
        }
        return hostname;
    }

    public  MessagingPlatformConfiguration(SystemInfoProvider systemInfoProvider);

}