| | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.cloud.netflix.feign.EnableFeignClients; |
| | | import org.springframework.context.ApplicationContext; |
| | | |
| | | import java.net.InetAddress; |
| | |
| | | "com.java110.config.properties.code"}) |
| | | //@SpringBootApplication(scanBasePackages = {"com.java110.service","com.java110.code","com.java110.config.properties.code"}) |
| | | @EnableDiscoveryClient |
| | | @EnableFeignClients(basePackages = {"com.java110.core.smo"}) |
| | | public class CodeServiceApplicationStart { |
| | | protected final static Logger logger = LoggerFactory.getLogger(CodeServiceApplicationStart.class); |
| | | |
| | |
| | | }); |
| | | |
| | | |
| | | |
| | | Stat stat = zooKeeper.exists(zookeeperProperties.getWorkDir(),true); |
| | | |
| | | if(stat == null){ |
| | |
| | | String[] pathTokens = workDir.split("/"); |
| | | if ( pathTokens.length > 0 |
| | | && pathTokens[pathTokens.length -1].contains("-") |
| | | && pathTokens[pathTokens.length -1].contains(":")) |
| | | { |
| | | && pathTokens[pathTokens.length - 1].contains(":")) { |
| | | String workId = pathTokens[pathTokens.length -1].substring(pathTokens[pathTokens.length -1].indexOf("-")+1); |
| | | serviceInfoListener.setWorkId(Long.parseLong(workId)); |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | throw new StartException(ResponseConstant.RESULT_CODE_ERROR,"系统启动失败,链接zookeeper失败"+zookeeperProperties.getZookeeperConnectString()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |