@Override
    public void afterPropertiesSet() throws Exception {
        properties.checkProperties();

        agent = new MonitorAgent();

        agent.setRegistryAddress(properties.getRegistryAddress());
        if (StringUtils.isNotEmpty(properties.getClusterName())) {
            agent.setClusterName(properties.getClusterName());
        }
        if (StringUtils.isNotEmpty(properties.getIdentity())) {
            agent.setIdentity(properties.getIdentity());
        }
        if (StringUtils.isNotEmpty(properties.getBindIp())) {
            agent.setBindIp(properties.getBindIp());
        }
        if (CollectionUtils.isNotEmpty(properties.getConfigs())) {
            for (Map.Entry<String, String> entry : properties.getConfigs().entrySet()) {
                agent.addConfig(entry.getKey(), entry.getValue());
            }
        }

        agent.start();
    }
@author Robert HG (254963746@qq.com) on 4/9/16.
lts-spring/src/main/java/com/github/ltsopensource/spring/boot/MonitorAutoConfiguration.java