作者 crossoverJie

:sparkles: Introducing new features.

... ... @@ -72,7 +72,10 @@ public class IndexController {
@ResponseBody
public BaseResponse<NULLBody> sendStringMsg(@RequestBody StringReqVO stringReqVO){
BaseResponse<NULLBody> res = new BaseResponse();
for (int i = 0; i < 100; i++) {
heartbeatClient.sendStringMsg(stringReqVO.getMsg()) ;
}
// 利用 actuator 来自增
counterService.increment(Constants.COUNTER_CLIENT_PUSH_COUNT);
... ... @@ -95,7 +98,9 @@ public class IndexController {
public BaseResponse<NULLBody> sendProtoBufMsg(@RequestBody GoogleProtocolVO googleProtocolVO){
BaseResponse<NULLBody> res = new BaseResponse();
for (int i = 0; i < 100; i++) {
heartbeatClient.sendGoogleProtocolMsg(googleProtocolVO) ;
}
// 利用 actuator 来自增
counterService.increment(Constants.COUNTER_CLIENT_PUSH_COUNT);
... ...
... ... @@ -28,14 +28,15 @@ public class CustomerHandleInitializer extends ChannelInitializer<Channel> {
//.addLast(new HeartbeatEncode())
// google Protobuf 编解码
//拆包解码
.addLast(new ProtobufVarint32FrameDecoder())
.addLast(new ProtobufDecoder(BaseResponseProto.ResponseProtocol.getDefaultInstance()))
//
//拆包编码
.addLast(new ProtobufVarint32LengthFieldPrepender())
.addLast(new ProtobufEncoder())
.addLast(new EchoClientHandle())
;
}
... ...