package com.xxl.job.executor;

import com.alibaba.dubbo.common.utils.ConfigUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.Properties;

/**
 * @author xuxueli 2018-10-28 00:38:13
 */
@SpringBootApplication
public class XxlJobExecutorApplication {

	public static void main(String[] args) {
		initZookeeperAddres(args);
		SpringApplication.run(XxlJobExecutorApplication.class, args);
	}

	/**
	 * 促使化dubbo注册中心的地址
	 * @param args
	 */
	private static void initZookeeperAddres(String[] args){
		String addres = "zookeeper://" + args[0];
		Properties properties = new Properties();
		properties.setProperty("dubbo.registry.address",addres);
		ConfigUtils.addProperties(properties);
	}

}