upd
This commit is contained in:
parent
9597bcc388
commit
f531f4e1e9
|
@ -18,6 +18,12 @@
|
|||
<name>子模块-配置中心sdk</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.odboy</groupId>
|
||||
<artifactId>kenaito-config-common</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>cn.odboy</groupId>
|
||||
<artifactId>kenaito-config-core</artifactId>
|
||||
<artifactId>kenaito-config-common</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package cn.odboy;
|
|||
|
||||
import cn.odboy.infra.context.EasyBootApplication;
|
||||
import cn.odboy.infra.context.SpringContextHolder;
|
||||
import com.alibaba.fastjson.parser.ParserConfig;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -12,14 +11,14 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|||
@EnableAsync
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
public class AppRun extends EasyBootApplication {
|
||||
public class KenaitoConfigServiceRun extends EasyBootApplication {
|
||||
@Bean
|
||||
public SpringContextHolder springContextHolder() {
|
||||
return new SpringContextHolder();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication springApplication = new SpringApplication(AppRun.class);
|
||||
SpringApplication springApplication = new SpringApplication(KenaitoConfigServiceRun.class);
|
||||
initd(springApplication.run(args));
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package cn.odboy.infra.netty;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.odboy.config.ConfigCenterProperties;
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
|
@ -12,14 +11,14 @@ import io.netty.channel.socket.SocketChannel;
|
|||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ConfigNettyServer implements InitializingBean {
|
||||
@Autowired
|
||||
private ConfigCenterProperties properties;
|
||||
@Value("${kenaito.config-center.port}")
|
||||
private Integer configCenterPort;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
|
@ -48,7 +47,7 @@ public class ConfigNettyServer implements InitializingBean {
|
|||
}
|
||||
});
|
||||
log.info("Netty Server Start...");
|
||||
ChannelFuture channelFuture = serverBootstrap.bind(properties.getPort()).sync();
|
||||
ChannelFuture channelFuture = serverBootstrap.bind(configCenterPort).sync();
|
||||
channelFuture.channel().closeFuture().sync();
|
||||
} finally {
|
||||
bossGroup.shutdownGracefully();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
kenaito:
|
||||
config-center:
|
||||
server: 127.0.0.1
|
||||
port: 28002
|
||||
data-id: kenaito-config-service
|
||||
cache-dir: c:\\data
|
||||
env: daily
|
|
@ -246,3 +246,6 @@ task:
|
|||
keep-alive-seconds: 60
|
||||
# 队列容量
|
||||
queue-capacity: 50
|
||||
kenaito:
|
||||
config-center:
|
||||
port: 28002
|
|
@ -1,7 +0,0 @@
|
|||
kenaito:
|
||||
config-center:
|
||||
server: 127.0.0.1
|
||||
port: 28002
|
||||
data-id: kenaito-config-service
|
||||
cache-dir: /home/admin/data
|
||||
env: production
|
|
@ -1,7 +0,0 @@
|
|||
kenaito:
|
||||
config-center:
|
||||
server: 127.0.0.1
|
||||
port: 28002
|
||||
data-id: kenaito-config-service
|
||||
cache-dir: /home/admin/data
|
||||
env: stage
|
|
@ -1,4 +1,4 @@
|
|||
spring:
|
||||
profiles:
|
||||
# 激活哪个配置文件, application-{active}.yml
|
||||
active: daily
|
||||
active: dev
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -13,8 +13,10 @@
|
|||
<module>kenaito-common</module>
|
||||
<module>kenaito-tools</module>
|
||||
<module>kenaito-system</module>
|
||||
<module>kenaito-config-common</module>
|
||||
<module>kenaito-config-core</module>
|
||||
<module>kenaito-config-service</module>
|
||||
<module>kenaito-config-demo</module>
|
||||
</modules>
|
||||
|
||||
<name>Kenaito Config</name>
|
||||
|
|
Loading…
Reference in New Issue