File tree Expand file tree Collapse file tree
rocketmq-remoting/src/rpc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818use std:: any:: Any ;
1919
2020use bytes:: Bytes ;
21- use bytes:: BytesMut ;
2221
2322use crate :: protocol:: remoting_command:: RemotingCommand ;
24- use crate :: protocol:: RemotingSerializable ;
2523use crate :: rpc:: rpc_request:: RpcRequest ;
2624use crate :: rpc:: rpc_response:: RpcResponse ;
2725
2826pub struct RpcClientUtils ;
2927
3028impl RpcClientUtils {
3129 pub fn create_command_for_rpc_request ( rpc_request : RpcRequest ) -> RemotingCommand {
32- let cmd = RemotingCommand :: create_request_command ( rpc_request. code , rpc_request. header ) ;
33- cmd. set_body ( Self :: encode_body ( & * * rpc_request. body ) )
30+ RemotingCommand :: create_request_command ( rpc_request. code , rpc_request. header )
31+ // cmd.set_body(Self::encode_body(&**rpc_request.body))
3432 }
3533
3634 pub fn create_command_for_rpc_response ( mut rpc_response : RpcResponse ) -> RemotingCommand {
@@ -43,13 +41,13 @@ impl RpcClientUtils {
4341 None => { }
4442 Some ( value) => cmd. set_remark_ref ( Some ( value. 1 . clone ( ) ) ) ,
4543 }
46- if let Some ( ref body ) = rpc_response. body {
47- return cmd. set_body ( Self :: encode_body ( & * * body ) ) ;
44+ if let Some ( ref _body ) = rpc_response. body {
45+ return cmd;
4846 }
4947 cmd
5048 }
5149
52- pub fn encode_body ( body : & dyn Any ) -> Option < Bytes > {
50+ pub fn encode_body ( _body : & dyn Any ) -> Option < Bytes > {
5351 // if body.is::<()>() {
5452 // None
5553 // } else if let Some(bytes) = body.downcast_ref::<Bytes>() {
You can’t perform that action at this time.
0 commit comments