This commit is contained in:
六如
2024-12-21 20:16:00 +08:00
parent f7f04c28eb
commit bb2a9eb314
116 changed files with 2124 additions and 2194 deletions

View File

@@ -54,7 +54,7 @@ public class EmbeddedZooKeeper implements SmartLifecycle {
/**
* Logger.
*/
private static final Logger logger = LoggerFactory.getLogger(EmbeddedZooKeeper.class);
private static final Logger LOG = LoggerFactory.getLogger(EmbeddedZooKeeper.class);
/**
* ZooKeeper client port. This will be determined dynamically upon startup.
@@ -196,7 +196,7 @@ public class EmbeddedZooKeeper implements SmartLifecycle {
zkServerThread = null;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.warn("Interrupted while waiting for embedded ZooKeeper to exit");
LOG.warn("Interrupted while waiting for embedded ZooKeeper to exit");
// abandoning zk thread
zkServerThread = null;
}
@@ -251,7 +251,7 @@ public class EmbeddedZooKeeper implements SmartLifecycle {
if (errorHandler != null) {
errorHandler.handleError(e);
} else {
logger.error("Exception running embedded ZooKeeper", e);
LOG.error("Exception running embedded ZooKeeper", e);
}
}
}

View File

@@ -1,17 +1,22 @@
package com.gitee.sop.registry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author 六如
*/
public class RegistryMain {
private static final Logger LOG = LoggerFactory.getLogger(RegistryMain.class);
/*
内置简单的注册中心,基于zookeeper,用来开发演示使用.
生产环境不可使用!
*/
public static void main(String[] args) {
int zkPort = 2181;
System.out.println("启动内置zookeeper注册中心(仅在开发环境下使用),port=" + zkPort);
LOG.warn("启动内置zookeeper注册中心(仅在开发环境下使用),port={}", zkPort);
new EmbeddedZooKeeper(zkPort, false).start();
}
}