Ver código fonte

增加OkHttp配置文件读取

tags/v1.0.0^2
林万龙 3 anos atrás
pai
commit
009d2f0967
2 arquivos alterados com 4 adições e 13 exclusões
  1. +1
    -11
      src/main/java/com/telpo/dipperposition/DipperPositionApplication.java
  2. +3
    -2
      src/main/java/com/telpo/dipperposition/server/DipperPositionServer.java

+ 1
- 11
src/main/java/com/telpo/dipperposition/DipperPositionApplication.java Ver arquivo

@@ -47,19 +47,9 @@ public class DipperPositionApplication {
PositionConfigInfo pci;
pci = (PositionConfigInfo)environment.getSystemProperties().get("position-server");
DipperPositionServer nettyServer2 = new DipperPositionServer(pci);
nettyServer2.start();
} catch (Exception e) {
log.error(e.getMessage());
}
}

private static void test() throws NacosException {
String serverAddr = "172.16.192.26";
String dataId = "dipperposition-service";
String group = "DEFAULT_GROUP";
Properties properties = new Properties();
properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);
ConfigService configService = NacosFactory.createConfigService(properties);
String content = configService.getConfig(dataId, group, 5000);
System.out.println(content);
}
}

+ 3
- 2
src/main/java/com/telpo/dipperposition/server/DipperPositionServer.java Ver arquivo

@@ -14,6 +14,8 @@ import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import lombok.extern.slf4j.Slf4j;

import java.net.InetSocketAddress;

/**
* @program: DipperPositionServer
* @description: 北斗定位
@@ -153,8 +155,7 @@ public class DipperPositionServer {
EventLoopGroup mainThreadGroup = new NioEventLoopGroup(1);
//new 一个工作线程组
EventLoopGroup workThreadGroup = new NioEventLoopGroup(200);
//InetSocketAddress socketAddress = new InetSocketAddress(serverAddr,
// starsAsycPort);
//InetSocketAddress socketAddress = new InetSocketAddress(serverAddr,null);
ServerBootstrap bootstrap = new ServerBootstrap()
.group(mainThreadGroup, workThreadGroup)
.channel(NioServerSocketChannel.class)


Carregando…
Cancelar
Salvar