netty权威指南学习笔记八——编解码技术之JBoss Marshalling
JBoss Marshalling 是一个java序列化包,对JDK默认的序列化框架进行了优化,但又保持跟java.io.Serializable接口的兼容,同时增加了一些可调参数和附加特性,这些参数和特性可以通过工厂类进行配置。
一、开发环境准备
要用到JBoss Marsharlling编解码就需要相应的jar包,这里我们需要引入其api和序列化类库。
首先在maven仓库中查找竟然没找到,只好官网下载了http://jbossmarshalling.jboss.org/downloads
下载后添加到idea中
点击OK即可后,再点击后面页面的OK即可添加进来,如下图:
二、代码编写运行
本节主要是对Marshalling的编解码功能进行学习,故而建立在上一小节的基础上,公用上一小节的POJO和server/client端的handler,下面贴出本博主的其他代码,同时折叠与上一小节相同的代码及运行结果。
服务端代码
1 package com.jbossMarshalling; 2 3 import com.protobuf.SubReqServerHandler; 4 import io.netty.bootstrap.ServerBootstrap; 5 import io.netty.channel.ChannelFuture; 6 import io.netty.channel.ChannelInitializer; 7 import io.netty.channel.ChannelOption; 8 import io.netty.channel.EventLoopGroup; 9 import io.netty.channel.nio.NioEventLoopGroup; 10 import io.netty.channel.socket.SocketChannel; 11 import io.netty.channel.socket.nio.NioServerSocketChannel; 12 import io.netty.handler.logging.LogLevel; 13 import io.netty.handler.logging.LoggingHandler; 14 15 public class SubReqServer { 16 public void bind(int port) throws InterruptedException { 17 EventLoopGroup bossGroup = new NioEventLoopGroup(); 18 EventLoopGroup workGroup = new NioEventLoopGroup(); 19 try { 20 ServerBootstrap b = new ServerBootstrap(); 21 b.group(bossGroup,workGroup).channel(NioServerSocketChannel.class) 22 .option(ChannelOption.SO_BACKLOG,100) 23 .handler(new LoggingHandler(LogLevel.INFO)) 24 .childHandler(new ChannelInitializer<SocketChannel>() { 25 @Override 26 protected void initChannel(SocketChannel socketChannel) throws Exception { 27 socketChannel.pipeline().addLast(MarshallingCodeCFactory.buildMarshallingDecoder()) 28 .addLast(MarshallingCodeCFactory.buildMarshallingEncoder()) 29 .addLast(new SubReqServerHandler()); 30 } 31 }); 32 ChannelFuture f = b.bind(port).sync(); 33 f.channel().closeFuture().sync(); 34 }finally { 35 bossGroup.shutdownGracefully(); 36 workGroup.shutdownGracefully(); 37 } 38 } 39 public static void main(String[] args) throws InterruptedException { 40 int port = 8080; 41 try{ 42 if(args.length>0&&args!=null){ 43 port = Integer.valueOf(args[0]); 44 } 45 }catch (NumberFormatException e){ 46 47 } 48 new SubReqServer().bind(port); 49 } 50 }
编解码代码
1 package com.jbossMarshalling; 2 3 import io.netty.handler.codec.marshalling.*; 4 import org.jboss.marshalling.MarshallerFactory; 5 import org.jboss.marshalling.Marshalling; 6 import org.jboss.marshalling.MarshallingConfiguration; 7 8 public final class MarshallingCodeCFactory { 9 public static MarshallingDecoder buildMarshallingDecoder(){ 10 // 通过Marshalling工具类的getProvidedMarshallerFactory获取静态MarshallerFactory工厂实例,参数serial表示创建的是 11 // java序列化工厂对象。 12 final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial"); 13 // 创建MarshallingConfiguration对象,将其版本号设置为5 14 final MarshallingConfiguration configuration = new MarshallingConfiguration(); 15 configuration.setVersion(5); 16 // 根据工厂及配置创建UnmarshallerProvider实例 17 UnmarshallerProvider provider = new DefaultUnmarshallerProvider(marshallerFactory,configuration); 18 // 通过构造函数创建netty的MarshallingDecoder 19 MarshallingDecoder decoder = new MarshallingDecoder(provider,1024); 20 return decoder; 21 } 22 public static MarshallingEncoder buildMarshallingEncoder(){ 23 final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial"); 24 final MarshallingConfiguration configuration = new MarshallingConfiguration(); 25 configuration.setVersion(5); 26 MarshallerProvider provider = new DefaultMarshallerProvider(marshallerFactory,configuration); 27 // 创建的下列解码器用于实现序列化接口的POJO对象序列化为二进制数组 28 MarshallingEncoder encoder = new MarshallingEncoder(provider); 29 return encoder; 30 } 31 }
服务端Handler
1 package com.protobuf; 2 3 import io.netty.channel.ChannelHandlerContext; 4 import io.netty.channel.ChannelInboundHandlerAdapter; 5 6 public class SubReqServerHandler extends ChannelInboundHandlerAdapter { 7 @Override 8 public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { 9 SubscribeReqProto.SubscribeReq req = (SubscribeReqProto.SubscribeReq) msg; 10 if ("zuixiaoyao".equals(req.getUserName())){ 11 System.out.println("服务端接收到客户端SubcribeReq的请求:【"+req.toString()+"】"); 12 ctx.writeAndFlush(resp(req.getSubReqID())); 13 }else { 14 System.out.println("用户名不相同!"); 15 } 16 17 } 18 19 private SubscribeRespProto.SubscribeResp resp(int subReqID) { 20 SubscribeRespProto.SubscribeResp.Builder builder = SubscribeRespProto.SubscribeResp.newBuilder(); 21 builder.setRespcode(0); 22 builder.setSubReqID(subReqID); 23 builder.setDesc("order success!"); 24 return builder.build(); 25 } 26 27 @Override 28 public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { 29 ctx.flush(); 30 } 31 32 @Override 33 public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { 34 ctx.close(); 35 } 36 }
客户端
1 package com.jbossMarshalling; 2 3 import com.protobuf.SubReqClientHandler; 4 import io.netty.bootstrap.Bootstrap; 5 import io.netty.channel.ChannelFuture; 6 import io.netty.channel.ChannelInitializer; 7 import io.netty.channel.ChannelOption; 8 import io.netty.channel.EventLoopGroup; 9 import io.netty.channel.nio.NioEventLoopGroup; 10 import io.netty.channel.socket.SocketChannel; 11 import io.netty.channel.socket.nio.NioSocketChannel; 12 13 14 public class SubSeqClient { 15 public void connect(String host,int port) throws InterruptedException { 16 EventLoopGroup group = new NioEventLoopGroup(); 17 try{ 18 Bootstrap b = new Bootstrap(); 19 b.group(group).channel(NioSocketChannel.class).option(ChannelOption.TCP_NODELAY,true) 20 .handler(new ChannelInitializer<SocketChannel>() { 21 @Override 22 protected void initChannel(SocketChannel socketChannel) throws Exception { 23 socketChannel.pipeline().addLast(MarshallingCodeCFactory.buildMarshallingDecoder()) 24 .addLast(MarshallingCodeCFactory.buildMarshallingEncoder()) 25 .addLast(new SubReqClientHandler()); 26 } 27 }); 28 ChannelFuture f = b.connect(host,port).sync(); 29 f.channel().closeFuture().sync(); 30 }finally { 31 group.shutdownGracefully(); 32 } 33 34 } 35 36 public static void main(String[] args) throws InterruptedException { 37 int port = 8080; 38 try{ 39 if(args.length>0&&args!=null){ 40 port = Integer.valueOf(args[0]); 41 } 42 }catch (NumberFormatException e){ 43 44 } 45 new SubSeqClient().connect("127.0.0.1",port); 46 } 47 }
客户端Handler
1 package com.protobuf; 2 3 import io.netty.channel.ChannelHandlerContext; 4 import io.netty.channel.ChannelInboundHandlerAdapter; 5 6 import java.util.ArrayList; 7 import java.util.List; 8 9 public class SubReqClientHandler extends ChannelInboundHandlerAdapter { 10 @Override 11 public void channelActive(ChannelHandlerContext ctx) throws Exception { 12 for(int i=0;i<10;i++){ 13 ctx.write(subReq(i)); 14 } 15 ctx.flush(); 16 } 17 18 private SubscribeReqProto.SubscribeReq subReq(int i) { 19 SubscribeReqProto.SubscribeReq.Builder builder = SubscribeReqProto.SubscribeReq.newBuilder(); 20 builder.setUserName("zuixiaoyao"); 21 builder.setProductName("xiguahong"); 22 builder.setSubReqID(i); 23 List<String> address = new ArrayList<>(); 24 address.add("tianjin hongqiao"); 25 address.add("henan luoyang"); 26 address.add("shenzhen luohu"); 27 address.add("hebei qinhuangdao"); 28 builder.addAllAddress(address); 29 return builder.build(); 30 } 31 32 @Override 33 public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { 34 System.out.println("接收服务端相应:【"+msg+"】"); 35 } 36 37 @Override 38 public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { 39 ctx.flush(); 40 } 41 42 @Override 43 public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { 44 ctx.close(); 45 } 46 }
运行结果
客户端结果
1 D:\java\java1.8\jdk1.8\bin\java.exe "-javaagent:D:\我的软件\itSoft\IntelliJ IDEA\IntelliJ IDEA 2018.1.5\lib\idea_rt.jar=58058:D:\我的软件\itSoft\IntelliJ IDEA\IntelliJ IDEA 2018.1.5\bin" -Dfile.encoding=UTF-8 -classpath D:\java\java1.8\jdk1.8\jre\lib\charsets.jar;D:\java\java1.8\jdk1.8\jre\lib\deploy.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\cldrdata.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\dnsns.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\jaccess.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\jfxrt.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\localedata.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\nashorn.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\sunec.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\zipfs.jar;D:\java\java1.8\jdk1.8\jre\lib\javaws.jar;D:\java\java1.8\jdk1.8\jre\lib\jce.jar;D:\java\java1.8\jdk1.8\jre\lib\jfr.jar;D:\java\java1.8\jdk1.8\jre\lib\jfxswt.jar;D:\java\java1.8\jdk1.8\jre\lib\jsse.jar;D:\java\java1.8\jdk1.8\jre\lib\management-agent.jar;D:\java\java1.8\jdk1.8\jre\lib\plugin.jar;D:\java\java1.8\jdk1.8\jre\lib\resources.jar;D:\java\java1.8\jdk1.8\jre\lib\rt.jar;D:\netty\target\classes;D:\jboss-marshalling-1.3.0.CR9.jar;D:\jboss-marshalling-serial-1.3.0.CR9.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-data-redis\2.0.3.RELEASE\spring-boot-starter-data-redis-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter\2.0.3.RELEASE\spring-boot-starter-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot\2.0.3.RELEASE\spring-boot-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.0.3.RELEASE\spring-boot-autoconfigure-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.0.3.RELEASE\spring-boot-starter-logging-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\litan\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\litan\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.10.0\log4j-to-slf4j-2.10.0.jar;C:\Users\litan\.m2\repository\org\apache\logging\log4j\log4j-api\2.10.0\log4j-api-2.10.0.jar;C:\Users\litan\.m2\repository\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar;C:\Users\litan\.m2\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;C:\Users\litan\.m2\repository\org\yaml\snakeyaml\1.19\snakeyaml-1.19.jar;C:\Users\litan\.m2\repository\org\springframework\data\spring-data-redis\2.0.8.RELEASE\spring-data-redis-2.0.8.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\data\spring-data-keyvalue\2.0.8.RELEASE\spring-data-keyvalue-2.0.8.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\data\spring-data-commons\2.0.8.RELEASE\spring-data-commons-2.0.8.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-tx\5.0.7.RELEASE\spring-tx-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-oxm\5.0.7.RELEASE\spring-oxm-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-aop\5.0.7.RELEASE\spring-aop-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-context-support\5.0.7.RELEASE\spring-context-support-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;C:\Users\litan\.m2\repository\io\lettuce\lettuce-core\5.0.4.RELEASE\lettuce-core-5.0.4.RELEASE.jar;C:\Users\litan\.m2\repository\io\projectreactor\reactor-core\3.1.8.RELEASE\reactor-core-3.1.8.RELEASE.jar;C:\Users\litan\.m2\repository\org\reactivestreams\reactive-streams\1.0.2\reactive-streams-1.0.2.jar;C:\Users\litan\.m2\repository\io\netty\netty-common\4.1.25.Final\netty-common-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-transport\4.1.25.Final\netty-transport-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-buffer\4.1.25.Final\netty-buffer-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-resolver\4.1.25.Final\netty-resolver-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-handler\4.1.25.Final\netty-handler-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-codec\4.1.25.Final\netty-codec-4.1.25.Final.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.0.3.RELEASE\spring-boot-starter-web-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.0.3.RELEASE\spring-boot-starter-json-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.6\jackson-databind-2.9.6.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.6\jackson-core-2.9.6.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.6\jackson-datatype-jdk8-2.9.6.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.6\jackson-datatype-jsr310-2.9.6.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.6\jackson-module-parameter-names-2.9.6.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.0.3.RELEASE\spring-boot-starter-tomcat-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.31\tomcat-embed-core-8.5.31.jar;C:\Users\litan\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\8.5.31\tomcat-embed-el-8.5.31.jar;C:\Users\litan\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\8.5.31\tomcat-embed-websocket-8.5.31.jar;C:\Users\litan\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.10.Final\hibernate-validator-6.0.10.Final.jar;C:\Users\litan\.m2\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;C:\Users\litan\.m2\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;C:\Users\litan\.m2\repository\com\fasterxml\classmate\1.3.4\classmate-1.3.4.jar;C:\Users\litan\.m2\repository\org\springframework\spring-web\5.0.7.RELEASE\spring-web-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-beans\5.0.7.RELEASE\spring-beans-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-webmvc\5.0.7.RELEASE\spring-webmvc-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-context\5.0.7.RELEASE\spring-context-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-expression\5.0.7.RELEASE\spring-expression-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar;C:\Users\litan\.m2\repository\org\springframework\spring-core\5.0.7.RELEASE\spring-core-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-jcl\5.0.7.RELEASE\spring-jcl-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\io\netty\netty-all\4.1.25.Final\netty-all-4.1.25.Final.jar;C:\Users\litan\.m2\repository\org\msgpack\msgpack\0.6.11\msgpack-0.6.11.jar;C:\Users\litan\.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\litan\.m2\repository\org\javassist\javassist\3.18.1-GA\javassist-3.18.1-GA.jar;C:\Users\litan\.m2\repository\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar com.jbossMarshalling.SubSeqClient 2 17:21:53.416 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework 3 17:21:53.440 [main] DEBUG io.netty.channel.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 8 4 17:21:53.506 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false 5 17:21:53.506 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512 6 17:21:53.540 [main] DEBUG io.netty.util.internal.PlatformDependent - Platform: Windows 7 17:21:53.542 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false 8 17:21:53.543 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 8 9 17:21:53.546 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available 10 17:21:53.547 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available 11 17:21:53.548 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available 12 17:21:53.549 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: available 13 17:21:53.550 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true 14 17:21:53.550 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9 15 17:21:53.550 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): available 16 17:21:53.550 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available 17 17:21:53.551 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: C:\Users\litan\AppData\Local\Temp (java.io.tmpdir) 18 17:21:53.551 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model) 19 17:21:53.553 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false 20 17:21:53.553 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: 1890582528 bytes 21 17:21:53.553 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1 22 17:21:53.554 [main] DEBUG io.netty.util.internal.CleanerJava6 - java.nio.ByteBuffer.cleaner(): available 23 17:21:53.569 [main] DEBUG io.netty.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available 24 17:21:54.096 [main] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 10248 (auto-detected) 25 17:21:54.102 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false 26 17:21:54.102 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false 27 17:21:54.406 [main] DEBUG io.netty.util.NetUtil - Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1) 28 17:21:54.407 [main] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200 29 17:21:54.906 [main] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: 00:50:56:ff:fe:c0:00:01 (auto-detected) 30 17:21:54.939 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024 31 17:21:54.939 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096 32 17:21:54.979 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple 33 17:21:54.979 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4 34 17:21:55.019 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 8 35 17:21:55.019 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 8 36 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192 37 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 11 38 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 16777216 39 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.tinyCacheSize: 512 40 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256 41 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64 42 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768 43 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192 44 17:21:55.020 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: true 45 17:21:55.035 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled 46 17:21:55.035 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 0 47 17:21:55.035 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384 48 17:21:55.284 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 4096 49 17:21:55.284 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxSharedCapacityFactor: 2 50 17:21:55.284 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.linkCapacity: 16 51 17:21:55.284 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.ratio: 8 52 17:21:55.348 [nioEventLoopGroup-2-1] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.bytebuf.checkAccessible: true 53 17:21:55.351 [nioEventLoopGroup-2-1] DEBUG io.netty.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@70cd33b9 54 接收服务端相应:【desc: "order success!" 55 】 56 接收服务端相应:【subReqID: 1 57 desc: "order success!" 58 】 59 接收服务端相应:【subReqID: 2 60 desc: "order success!" 61 】 62 接收服务端相应:【subReqID: 3 63 desc: "order success!" 64 】 65 接收服务端相应:【subReqID: 4 66 desc: "order success!" 67 】 68 接收服务端相应:【subReqID: 5 69 desc: "order success!" 70 】 71 接收服务端相应:【subReqID: 6 72 desc: "order success!" 73 】 74 接收服务端相应:【subReqID: 7 75 desc: "order success!" 76 】 77 接收服务端相应:【subReqID: 8 78 desc: "order success!" 79 】 80 接收服务端相应:【subReqID: 9 81 desc: "order success!" 82 】
服务端结果
1 D:\java\java1.8\jdk1.8\bin\java.exe "-javaagent:D:\我的软件\itSoft\IntelliJ IDEA\IntelliJ IDEA 2018.1.5\lib\idea_rt.jar=58020:D:\我的软件\itSoft\IntelliJ IDEA\IntelliJ IDEA 2018.1.5\bin" -Dfile.encoding=UTF-8 -classpath D:\java\java1.8\jdk1.8\jre\lib\charsets.jar;D:\java\java1.8\jdk1.8\jre\lib\deploy.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\cldrdata.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\dnsns.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\jaccess.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\jfxrt.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\localedata.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\nashorn.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\sunec.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\java\java1.8\jdk1.8\jre\lib\ext\zipfs.jar;D:\java\java1.8\jdk1.8\jre\lib\javaws.jar;D:\java\java1.8\jdk1.8\jre\lib\jce.jar;D:\java\java1.8\jdk1.8\jre\lib\jfr.jar;D:\java\java1.8\jdk1.8\jre\lib\jfxswt.jar;D:\java\java1.8\jdk1.8\jre\lib\jsse.jar;D:\java\java1.8\jdk1.8\jre\lib\management-agent.jar;D:\java\java1.8\jdk1.8\jre\lib\plugin.jar;D:\java\java1.8\jdk1.8\jre\lib\resources.jar;D:\java\java1.8\jdk1.8\jre\lib\rt.jar;D:\netty\target\classes;D:\jboss-marshalling-1.3.0.CR9.jar;D:\jboss-marshalling-serial-1.3.0.CR9.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-data-redis\2.0.3.RELEASE\spring-boot-starter-data-redis-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter\2.0.3.RELEASE\spring-boot-starter-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot\2.0.3.RELEASE\spring-boot-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.0.3.RELEASE\spring-boot-autoconfigure-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.0.3.RELEASE\spring-boot-starter-logging-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\litan\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\litan\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.10.0\log4j-to-slf4j-2.10.0.jar;C:\Users\litan\.m2\repository\org\apache\logging\log4j\log4j-api\2.10.0\log4j-api-2.10.0.jar;C:\Users\litan\.m2\repository\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar;C:\Users\litan\.m2\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;C:\Users\litan\.m2\repository\org\yaml\snakeyaml\1.19\snakeyaml-1.19.jar;C:\Users\litan\.m2\repository\org\springframework\data\spring-data-redis\2.0.8.RELEASE\spring-data-redis-2.0.8.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\data\spring-data-keyvalue\2.0.8.RELEASE\spring-data-keyvalue-2.0.8.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\data\spring-data-commons\2.0.8.RELEASE\spring-data-commons-2.0.8.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-tx\5.0.7.RELEASE\spring-tx-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-oxm\5.0.7.RELEASE\spring-oxm-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-aop\5.0.7.RELEASE\spring-aop-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-context-support\5.0.7.RELEASE\spring-context-support-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;C:\Users\litan\.m2\repository\io\lettuce\lettuce-core\5.0.4.RELEASE\lettuce-core-5.0.4.RELEASE.jar;C:\Users\litan\.m2\repository\io\projectreactor\reactor-core\3.1.8.RELEASE\reactor-core-3.1.8.RELEASE.jar;C:\Users\litan\.m2\repository\org\reactivestreams\reactive-streams\1.0.2\reactive-streams-1.0.2.jar;C:\Users\litan\.m2\repository\io\netty\netty-common\4.1.25.Final\netty-common-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-transport\4.1.25.Final\netty-transport-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-buffer\4.1.25.Final\netty-buffer-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-resolver\4.1.25.Final\netty-resolver-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-handler\4.1.25.Final\netty-handler-4.1.25.Final.jar;C:\Users\litan\.m2\repository\io\netty\netty-codec\4.1.25.Final\netty-codec-4.1.25.Final.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.0.3.RELEASE\spring-boot-starter-web-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.0.3.RELEASE\spring-boot-starter-json-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.6\jackson-databind-2.9.6.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.6\jackson-core-2.9.6.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.6\jackson-datatype-jdk8-2.9.6.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.6\jackson-datatype-jsr310-2.9.6.jar;C:\Users\litan\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.6\jackson-module-parameter-names-2.9.6.jar;C:\Users\litan\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.0.3.RELEASE\spring-boot-starter-tomcat-2.0.3.RELEASE.jar;C:\Users\litan\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.31\tomcat-embed-core-8.5.31.jar;C:\Users\litan\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\8.5.31\tomcat-embed-el-8.5.31.jar;C:\Users\litan\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\8.5.31\tomcat-embed-websocket-8.5.31.jar;C:\Users\litan\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.10.Final\hibernate-validator-6.0.10.Final.jar;C:\Users\litan\.m2\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;C:\Users\litan\.m2\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;C:\Users\litan\.m2\repository\com\fasterxml\classmate\1.3.4\classmate-1.3.4.jar;C:\Users\litan\.m2\repository\org\springframework\spring-web\5.0.7.RELEASE\spring-web-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-beans\5.0.7.RELEASE\spring-beans-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-webmvc\5.0.7.RELEASE\spring-webmvc-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-context\5.0.7.RELEASE\spring-context-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-expression\5.0.7.RELEASE\spring-expression-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar;C:\Users\litan\.m2\repository\org\springframework\spring-core\5.0.7.RELEASE\spring-core-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\org\springframework\spring-jcl\5.0.7.RELEASE\spring-jcl-5.0.7.RELEASE.jar;C:\Users\litan\.m2\repository\io\netty\netty-all\4.1.25.Final\netty-all-4.1.25.Final.jar;C:\Users\litan\.m2\repository\org\msgpack\msgpack\0.6.11\msgpack-0.6.11.jar;C:\Users\litan\.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\litan\.m2\repository\org\javassist\javassist\3.18.1-GA\javassist-3.18.1-GA.jar;C:\Users\litan\.m2\repository\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar com.jbossMarshalling.SubReqServer 2 17:21:36.123 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework 3 17:21:36.148 [main] DEBUG io.netty.channel.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 8 4 17:21:36.206 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false 5 17:21:36.206 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512 6 17:21:36.244 [main] DEBUG io.netty.util.internal.PlatformDependent - Platform: Windows 7 17:21:36.246 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false 8 17:21:36.246 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 8 9 17:21:36.248 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available 10 17:21:36.249 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available 11 17:21:36.250 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available 12 17:21:36.251 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: available 13 17:21:36.252 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true 14 17:21:36.252 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9 15 17:21:36.252 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): available 16 17:21:36.252 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available 17 17:21:36.253 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: C:\Users\litan\AppData\Local\Temp (java.io.tmpdir) 18 17:21:36.253 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model) 19 17:21:36.255 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false 20 17:21:36.255 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: 1890582528 bytes 21 17:21:36.255 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1 22 17:21:36.256 [main] DEBUG io.netty.util.internal.CleanerJava6 - java.nio.ByteBuffer.cleaner(): available 23 17:21:36.273 [main] DEBUG io.netty.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available 24 17:21:36.862 [main] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 13740 (auto-detected) 25 17:21:36.865 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false 26 17:21:36.865 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false 27 17:21:37.208 [main] DEBUG io.netty.util.NetUtil - Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1) 28 17:21:37.210 [main] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200 29 17:21:37.733 [main] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: 00:50:56:ff:fe:c0:00:01 (auto-detected) 30 17:21:37.744 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024 31 17:21:37.744 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096 32 17:21:37.783 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple 33 17:21:37.783 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4 34 17:21:37.832 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 8 35 17:21:37.832 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 8 36 17:21:37.832 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192 37 17:21:37.832 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 11 38 17:21:37.832 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 16777216 39 17:21:37.832 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.tinyCacheSize: 512 40 17:21:37.833 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256 41 17:21:37.833 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64 42 17:21:37.833 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768 43 17:21:37.833 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192 44 17:21:37.833 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: true 45 17:21:37.845 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled 46 17:21:37.845 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 0 47 17:21:37.845 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384 48 17:21:37.890 [nioEventLoopGroup-2-1] INFO io.netty.handler.logging.LoggingHandler - [id: 0xafc9e6f5] REGISTERED 49 17:21:37.892 [nioEventLoopGroup-2-1] INFO io.netty.handler.logging.LoggingHandler - [id: 0xafc9e6f5] BIND: 0.0.0.0/0.0.0.0:8080 50 17:21:37.896 [nioEventLoopGroup-2-1] INFO io.netty.handler.logging.LoggingHandler - [id: 0xafc9e6f5, L:/0:0:0:0:0:0:0:0:8080] ACTIVE 51 17:21:55.231 [nioEventLoopGroup-2-1] INFO io.netty.handler.logging.LoggingHandler - [id: 0xafc9e6f5, L:/0:0:0:0:0:0:0:0:8080] READ: [id: 0x29f6216e, L:/127.0.0.1:8080 - R:/127.0.0.1:58079] 52 17:21:55.233 [nioEventLoopGroup-2-1] INFO io.netty.handler.logging.LoggingHandler - [id: 0xafc9e6f5, L:/0:0:0:0:0:0:0:0:8080] READ COMPLETE 53 17:21:55.584 [nioEventLoopGroup-3-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 4096 54 17:21:55.584 [nioEventLoopGroup-3-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxSharedCapacityFactor: 2 55 17:21:55.584 [nioEventLoopGroup-3-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.linkCapacity: 16 56 17:21:55.584 [nioEventLoopGroup-3-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.ratio: 8 57 17:21:55.595 [nioEventLoopGroup-3-1] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.bytebuf.checkAccessible: true 58 17:21:55.596 [nioEventLoopGroup-3-1] DEBUG io.netty.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@75fea906 59 服务端接收到客户端SubcribeReq的请求:【userName: "zuixiaoyao" 60 productName: "xiguahong" 61 address: "tianjin hongqiao" 62 address: "henan luoyang" 63 address: "shenzhen luohu" 64 address: "hebei qinhuangdao" 65 】 66 服务端接收到客户端SubcribeReq的请求:【subReqID: 1 67 userName: "zuixiaoyao" 68 productName: "xiguahong" 69 address: "tianjin hongqiao" 70 address: "henan luoyang" 71 address: "shenzhen luohu" 72 address: "hebei qinhuangdao" 73 】 74 服务端接收到客户端SubcribeReq的请求:【subReqID: 2 75 userName: "zuixiaoyao" 76 productName: "xiguahong" 77 address: "tianjin hongqiao" 78 address: "henan luoyang" 79 address: "shenzhen luohu" 80 address: "hebei qinhuangdao" 81 】 82 服务端接收到客户端SubcribeReq的请求:【subReqID: 3 83 userName: "zuixiaoyao" 84 productName: "xiguahong" 85 address: "tianjin hongqiao" 86 address: "henan luoyang" 87 address: "shenzhen luohu" 88 address: "hebei qinhuangdao" 89 】 90 服务端接收到客户端SubcribeReq的请求:【subReqID: 4 91 userName: "zuixiaoyao" 92 productName: "xiguahong" 93 address: "tianjin hongqiao" 94 address: "henan luoyang" 95 address: "shenzhen luohu" 96 address: "hebei qinhuangdao" 97 】 98 服务端接收到客户端SubcribeReq的请求:【subReqID: 5 99 userName: "zuixiaoyao" 100 productName: "xiguahong" 101 address: "tianjin hongqiao" 102 address: "henan luoyang" 103 address: "shenzhen luohu" 104 address: "hebei qinhuangdao" 105 】 106 服务端接收到客户端SubcribeReq的请求:【subReqID: 6 107 userName: "zuixiaoyao" 108 productName: "xiguahong" 109 address: "tianjin hongqiao" 110 address: "henan luoyang" 111 address: "shenzhen luohu" 112 address: "hebei qinhuangdao" 113 】 114 服务端接收到客户端SubcribeReq的请求:【subReqID: 7 115 userName: "zuixiaoyao" 116 productName: "xiguahong" 117 address: "tianjin hongqiao" 118 address: "henan luoyang" 119 address: "shenzhen luohu" 120 address: "hebei qinhuangdao" 121 】 122 服务端接收到客户端SubcribeReq的请求:【subReqID: 8 123 userName: "zuixiaoyao" 124 productName: "xiguahong" 125 address: "tianjin hongqiao" 126 address: "henan luoyang" 127 address: "shenzhen luohu" 128 address: "hebei qinhuangdao" 129 】 130 服务端接收到客户端SubcribeReq的请求:【subReqID: 9 131 userName: "zuixiaoyao" 132 productName: "xiguahong" 133 address: "tianjin hongqiao" 134 address: "henan luoyang" 135 address: "shenzhen luohu" 136 address: "hebei qinhuangdao" 137 】
运行后的结果完全与上一小节相同,说明改编解码器完全正常。
本博主支持并坚持原创,本博客文章将以原创为主。