mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 12:56:28 +08:00
5.0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user