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:javajava1.8jdk1.8injava.exe "-javaagent:D:我的软件itSoftIntelliJ IDEAIntelliJ IDEA 2018.1.5libidea_rt.jar=58058:D:我的软件itSoftIntelliJ IDEAIntelliJ IDEA 2018.1.5in" -Dfile.encoding=UTF-8 -classpath D:javajava1.8jdk1.8jrelibcharsets.jar;D:javajava1.8jdk1.8jrelibdeploy.jar;D:javajava1.8jdk1.8jrelibextaccess-bridge-64.jar;D:javajava1.8jdk1.8jrelibextcldrdata.jar;D:javajava1.8jdk1.8jrelibextdnsns.jar;D:javajava1.8jdk1.8jrelibextjaccess.jar;D:javajava1.8jdk1.8jrelibextjfxrt.jar;D:javajava1.8jdk1.8jrelibextlocaledata.jar;D:javajava1.8jdk1.8jrelibext ashorn.jar;D:javajava1.8jdk1.8jrelibextsunec.jar;D:javajava1.8jdk1.8jrelibextsunjce_provider.jar;D:javajava1.8jdk1.8jrelibextsunmscapi.jar;D:javajava1.8jdk1.8jrelibextsunpkcs11.jar;D:javajava1.8jdk1.8jrelibextzipfs.jar;D:javajava1.8jdk1.8jrelibjavaws.jar;D:javajava1.8jdk1.8jrelibjce.jar;D:javajava1.8jdk1.8jrelibjfr.jar;D:javajava1.8jdk1.8jrelibjfxswt.jar;D:javajava1.8jdk1.8jrelibjsse.jar;D:javajava1.8jdk1.8jrelibmanagement-agent.jar;D:javajava1.8jdk1.8jrelibplugin.jar;D:javajava1.8jdk1.8jrelib esources.jar;D:javajava1.8jdk1.8jrelib t.jar;D: etty argetclasses;D:jboss-marshalling-1.3.0.CR9.jar;D:jboss-marshalling-serial-1.3.0.CR9.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-data-redis2.0.3.RELEASEspring-boot-starter-data-redis-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter2.0.3.RELEASEspring-boot-starter-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot2.0.3.RELEASEspring-boot-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-autoconfigure2.0.3.RELEASEspring-boot-autoconfigure-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-logging2.0.3.RELEASEspring-boot-starter-logging-2.0.3.RELEASE.jar;C:Userslitan.m2 epositorychqoslogbacklogback-classic1.2.3logback-classic-1.2.3.jar;C:Userslitan.m2 epositorychqoslogbacklogback-core1.2.3logback-core-1.2.3.jar;C:Userslitan.m2 epositoryorgapachelogginglog4jlog4j-to-slf4j2.10.0log4j-to-slf4j-2.10.0.jar;C:Userslitan.m2 epositoryorgapachelogginglog4jlog4j-api2.10.0log4j-api-2.10.0.jar;C:Userslitan.m2 epositoryorgslf4jjul-to-slf4j1.7.25jul-to-slf4j-1.7.25.jar;C:Userslitan.m2 epositoryjavaxannotationjavax.annotation-api1.3.2javax.annotation-api-1.3.2.jar;C:Userslitan.m2 epositoryorgyamlsnakeyaml1.19snakeyaml-1.19.jar;C:Userslitan.m2 epositoryorgspringframeworkdataspring-data-redis2.0.8.RELEASEspring-data-redis-2.0.8.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkdataspring-data-keyvalue2.0.8.RELEASEspring-data-keyvalue-2.0.8.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkdataspring-data-commons2.0.8.RELEASEspring-data-commons-2.0.8.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-tx5.0.7.RELEASEspring-tx-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-oxm5.0.7.RELEASEspring-oxm-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-aop5.0.7.RELEASEspring-aop-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-context-support5.0.7.RELEASEspring-context-support-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgslf4jslf4j-api1.7.25slf4j-api-1.7.25.jar;C:Userslitan.m2 epositoryiolettucelettuce-core5.0.4.RELEASElettuce-core-5.0.4.RELEASE.jar;C:Userslitan.m2 epositoryioprojectreactor eactor-core3.1.8.RELEASE eactor-core-3.1.8.RELEASE.jar;C:Userslitan.m2 epositoryorg eactivestreams eactive-streams1.0.2 eactive-streams-1.0.2.jar;C:Userslitan.m2 epositoryio etty etty-common4.1.25.Final etty-common-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-transport4.1.25.Final etty-transport-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-buffer4.1.25.Final etty-buffer-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-resolver4.1.25.Final etty-resolver-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-handler4.1.25.Final etty-handler-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-codec4.1.25.Final etty-codec-4.1.25.Final.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-web2.0.3.RELEASEspring-boot-starter-web-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-json2.0.3.RELEASEspring-boot-starter-json-2.0.3.RELEASE.jar;C:Userslitan.m2 epositorycomfasterxmljacksoncorejackson-databind2.9.6jackson-databind-2.9.6.jar;C:Userslitan.m2 epositorycomfasterxmljacksoncorejackson-annotations2.9.0jackson-annotations-2.9.0.jar;C:Userslitan.m2 epositorycomfasterxmljacksoncorejackson-core2.9.6jackson-core-2.9.6.jar;C:Userslitan.m2 epositorycomfasterxmljacksondatatypejackson-datatype-jdk82.9.6jackson-datatype-jdk8-2.9.6.jar;C:Userslitan.m2 epositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.9.6jackson-datatype-jsr310-2.9.6.jar;C:Userslitan.m2 epositorycomfasterxmljacksonmodulejackson-module-parameter-names2.9.6jackson-module-parameter-names-2.9.6.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-tomcat2.0.3.RELEASEspring-boot-starter-tomcat-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgapache omcatembed omcat-embed-core8.5.31 omcat-embed-core-8.5.31.jar;C:Userslitan.m2 epositoryorgapache omcatembed omcat-embed-el8.5.31 omcat-embed-el-8.5.31.jar;C:Userslitan.m2 epositoryorgapache omcatembed omcat-embed-websocket8.5.31 omcat-embed-websocket-8.5.31.jar;C:Userslitan.m2 epositoryorghibernatevalidatorhibernate-validator6.0.10.Finalhibernate-validator-6.0.10.Final.jar;C:Userslitan.m2 epositoryjavaxvalidationvalidation-api2.0.1.Finalvalidation-api-2.0.1.Final.jar;C:Userslitan.m2 epositoryorgjbossloggingjboss-logging3.3.2.Finaljboss-logging-3.3.2.Final.jar;C:Userslitan.m2 epositorycomfasterxmlclassmate1.3.4classmate-1.3.4.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-web5.0.7.RELEASEspring-web-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-beans5.0.7.RELEASEspring-beans-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-webmvc5.0.7.RELEASEspring-webmvc-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-context5.0.7.RELEASEspring-context-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-expression5.0.7.RELEASEspring-expression-5.0.7.RELEASE.jar;C:Userslitan.m2 epositorymysqlmysql-connector-java5.1.46mysql-connector-java-5.1.46.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-core5.0.7.RELEASEspring-core-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-jcl5.0.7.RELEASEspring-jcl-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryio etty etty-all4.1.25.Final etty-all-4.1.25.Final.jar;C:Userslitan.m2 epositoryorgmsgpackmsgpack .6.11msgpack-0.6.11.jar;C:Userslitan.m2 epositorycomgooglecodejson-simplejson-simple1.1.1json-simple-1.1.1.jar;C:Userslitan.m2 epositoryorgjavassistjavassist3.18.1-GAjavassist-3.18.1-GA.jar;C:Userslitan.m2 epositorycomgoogleprotobufprotobuf-java3.6.1protobuf-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:UserslitanAppDataLocalTemp (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 procsys etcoresomaxconn. 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:javajava1.8jdk1.8injava.exe "-javaagent:D:我的软件itSoftIntelliJ IDEAIntelliJ IDEA 2018.1.5libidea_rt.jar=58020:D:我的软件itSoftIntelliJ IDEAIntelliJ IDEA 2018.1.5in" -Dfile.encoding=UTF-8 -classpath D:javajava1.8jdk1.8jrelibcharsets.jar;D:javajava1.8jdk1.8jrelibdeploy.jar;D:javajava1.8jdk1.8jrelibextaccess-bridge-64.jar;D:javajava1.8jdk1.8jrelibextcldrdata.jar;D:javajava1.8jdk1.8jrelibextdnsns.jar;D:javajava1.8jdk1.8jrelibextjaccess.jar;D:javajava1.8jdk1.8jrelibextjfxrt.jar;D:javajava1.8jdk1.8jrelibextlocaledata.jar;D:javajava1.8jdk1.8jrelibext ashorn.jar;D:javajava1.8jdk1.8jrelibextsunec.jar;D:javajava1.8jdk1.8jrelibextsunjce_provider.jar;D:javajava1.8jdk1.8jrelibextsunmscapi.jar;D:javajava1.8jdk1.8jrelibextsunpkcs11.jar;D:javajava1.8jdk1.8jrelibextzipfs.jar;D:javajava1.8jdk1.8jrelibjavaws.jar;D:javajava1.8jdk1.8jrelibjce.jar;D:javajava1.8jdk1.8jrelibjfr.jar;D:javajava1.8jdk1.8jrelibjfxswt.jar;D:javajava1.8jdk1.8jrelibjsse.jar;D:javajava1.8jdk1.8jrelibmanagement-agent.jar;D:javajava1.8jdk1.8jrelibplugin.jar;D:javajava1.8jdk1.8jrelib esources.jar;D:javajava1.8jdk1.8jrelib t.jar;D: etty argetclasses;D:jboss-marshalling-1.3.0.CR9.jar;D:jboss-marshalling-serial-1.3.0.CR9.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-data-redis2.0.3.RELEASEspring-boot-starter-data-redis-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter2.0.3.RELEASEspring-boot-starter-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot2.0.3.RELEASEspring-boot-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-autoconfigure2.0.3.RELEASEspring-boot-autoconfigure-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-logging2.0.3.RELEASEspring-boot-starter-logging-2.0.3.RELEASE.jar;C:Userslitan.m2 epositorychqoslogbacklogback-classic1.2.3logback-classic-1.2.3.jar;C:Userslitan.m2 epositorychqoslogbacklogback-core1.2.3logback-core-1.2.3.jar;C:Userslitan.m2 epositoryorgapachelogginglog4jlog4j-to-slf4j2.10.0log4j-to-slf4j-2.10.0.jar;C:Userslitan.m2 epositoryorgapachelogginglog4jlog4j-api2.10.0log4j-api-2.10.0.jar;C:Userslitan.m2 epositoryorgslf4jjul-to-slf4j1.7.25jul-to-slf4j-1.7.25.jar;C:Userslitan.m2 epositoryjavaxannotationjavax.annotation-api1.3.2javax.annotation-api-1.3.2.jar;C:Userslitan.m2 epositoryorgyamlsnakeyaml1.19snakeyaml-1.19.jar;C:Userslitan.m2 epositoryorgspringframeworkdataspring-data-redis2.0.8.RELEASEspring-data-redis-2.0.8.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkdataspring-data-keyvalue2.0.8.RELEASEspring-data-keyvalue-2.0.8.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkdataspring-data-commons2.0.8.RELEASEspring-data-commons-2.0.8.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-tx5.0.7.RELEASEspring-tx-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-oxm5.0.7.RELEASEspring-oxm-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-aop5.0.7.RELEASEspring-aop-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-context-support5.0.7.RELEASEspring-context-support-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgslf4jslf4j-api1.7.25slf4j-api-1.7.25.jar;C:Userslitan.m2 epositoryiolettucelettuce-core5.0.4.RELEASElettuce-core-5.0.4.RELEASE.jar;C:Userslitan.m2 epositoryioprojectreactor eactor-core3.1.8.RELEASE eactor-core-3.1.8.RELEASE.jar;C:Userslitan.m2 epositoryorg eactivestreams eactive-streams1.0.2 eactive-streams-1.0.2.jar;C:Userslitan.m2 epositoryio etty etty-common4.1.25.Final etty-common-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-transport4.1.25.Final etty-transport-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-buffer4.1.25.Final etty-buffer-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-resolver4.1.25.Final etty-resolver-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-handler4.1.25.Final etty-handler-4.1.25.Final.jar;C:Userslitan.m2 epositoryio etty etty-codec4.1.25.Final etty-codec-4.1.25.Final.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-web2.0.3.RELEASEspring-boot-starter-web-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-json2.0.3.RELEASEspring-boot-starter-json-2.0.3.RELEASE.jar;C:Userslitan.m2 epositorycomfasterxmljacksoncorejackson-databind2.9.6jackson-databind-2.9.6.jar;C:Userslitan.m2 epositorycomfasterxmljacksoncorejackson-annotations2.9.0jackson-annotations-2.9.0.jar;C:Userslitan.m2 epositorycomfasterxmljacksoncorejackson-core2.9.6jackson-core-2.9.6.jar;C:Userslitan.m2 epositorycomfasterxmljacksondatatypejackson-datatype-jdk82.9.6jackson-datatype-jdk8-2.9.6.jar;C:Userslitan.m2 epositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.9.6jackson-datatype-jsr310-2.9.6.jar;C:Userslitan.m2 epositorycomfasterxmljacksonmodulejackson-module-parameter-names2.9.6jackson-module-parameter-names-2.9.6.jar;C:Userslitan.m2 epositoryorgspringframeworkootspring-boot-starter-tomcat2.0.3.RELEASEspring-boot-starter-tomcat-2.0.3.RELEASE.jar;C:Userslitan.m2 epositoryorgapache omcatembed omcat-embed-core8.5.31 omcat-embed-core-8.5.31.jar;C:Userslitan.m2 epositoryorgapache omcatembed omcat-embed-el8.5.31 omcat-embed-el-8.5.31.jar;C:Userslitan.m2 epositoryorgapache omcatembed omcat-embed-websocket8.5.31 omcat-embed-websocket-8.5.31.jar;C:Userslitan.m2 epositoryorghibernatevalidatorhibernate-validator6.0.10.Finalhibernate-validator-6.0.10.Final.jar;C:Userslitan.m2 epositoryjavaxvalidationvalidation-api2.0.1.Finalvalidation-api-2.0.1.Final.jar;C:Userslitan.m2 epositoryorgjbossloggingjboss-logging3.3.2.Finaljboss-logging-3.3.2.Final.jar;C:Userslitan.m2 epositorycomfasterxmlclassmate1.3.4classmate-1.3.4.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-web5.0.7.RELEASEspring-web-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-beans5.0.7.RELEASEspring-beans-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-webmvc5.0.7.RELEASEspring-webmvc-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-context5.0.7.RELEASEspring-context-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-expression5.0.7.RELEASEspring-expression-5.0.7.RELEASE.jar;C:Userslitan.m2 epositorymysqlmysql-connector-java5.1.46mysql-connector-java-5.1.46.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-core5.0.7.RELEASEspring-core-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryorgspringframeworkspring-jcl5.0.7.RELEASEspring-jcl-5.0.7.RELEASE.jar;C:Userslitan.m2 epositoryio etty etty-all4.1.25.Final etty-all-4.1.25.Final.jar;C:Userslitan.m2 epositoryorgmsgpackmsgpack .6.11msgpack-0.6.11.jar;C:Userslitan.m2 epositorycomgooglecodejson-simplejson-simple1.1.1json-simple-1.1.1.jar;C:Userslitan.m2 epositoryorgjavassistjavassist3.18.1-GAjavassist-3.18.1-GA.jar;C:Userslitan.m2 epositorycomgoogleprotobufprotobuf-java3.6.1protobuf-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:UserslitanAppDataLocalTemp (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 procsys etcoresomaxconn. 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 】
运行后的结果完全与上一小节相同,说明改编解码器完全正常。