This commit is contained in:
eson 2022-06-21 18:09:54 +08:00
parent fe396afe76
commit 15e84f54af
3 changed files with 5 additions and 6 deletions

View File

@ -27,7 +27,7 @@
<nacos.version>2.1.0</nacos.version> <nacos.version>2.1.0</nacos.version>
<snakeyaml.version>1.30</snakeyaml.version> <snakeyaml.version>1.30</snakeyaml.version>
<yuandian.common.config.version>1.0.0-SNAPSHOT</yuandian.common.config.version> <yuandian.common.config.version>1.0.2</yuandian.common.config.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -115,8 +115,8 @@ public class CollectPackets extends CollectPacketsServerImplBase {
// private final ManagedChannelBuilder<?> managedChannelBuilder; // private final ManagedChannelBuilder<?> managedChannelBuilder;
// private final CollectPacketsServerStub blockingStub; // private final CollectPacketsServerStub blockingStub;
// private final ManagedChannel channel; // private final ManagedChannel channel;
// public Client(String name, int port) { // public Client(String name, int port) {
@ -130,7 +130,7 @@ public class CollectPackets extends CollectPacketsServerImplBase {
// MyThing.Response response = blockingStub.sayHi(request); // MyThing.Response response = blockingStub.sayHi(request);
// System.out.println(response.getName()); // System.out.println(response.getName());
// } // }
var managedChannelBuilder = ManagedChannelBuilder.forAddress("localhost", 50051); var managedChannelBuilder = ManagedChannelBuilder.forAddress("10.1.1.117", 50051);
var channel = managedChannelBuilder.usePlaintext().build(); var channel = managedChannelBuilder.usePlaintext().build();
var stub = CollectPacketsServerGrpc.newBlockingStub(channel); var stub = CollectPacketsServerGrpc.newBlockingStub(channel);
// stub.withCompression("snappy"); // stub.withCompression("snappy");
@ -151,6 +151,5 @@ public class CollectPackets extends CollectPacketsServerImplBase {
log.info("条数:{}, {}:ms",i,Duration.between(now, Instant.now()).toMillis()); log.info("条数:{}, {}:ms",i,Duration.between(now, Instant.now()).toMillis());
} }
} }
} }

View File

@ -3,7 +3,7 @@
class="ch.qos.logback.core.ConsoleAppender"> class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern> <pattern>
%d{yyyyMMdd HH:mm:ss.SSS} %-5level[%thread\(%file:%line\)]: %msg%n %d{yyyyMMdd HH:mm:ss.SSS} %-5level%thread(%file:%line): %msg%n
</pattern> </pattern>
</encoder> </encoder>
</appender> </appender>