kitex-contrib / kitexcall

A command line tool for sending requests using kitex
Apache License 2.0
14 stars 5 forks source link

bug(pb): can access other service's method in multiple services #12

Open jkskj opened 1 month ago

jkskj commented 1 month ago

Describe the bug

can access other service's method in multiple services

//  kitexcall -idl-path  idl/echo.proto -m One/Two -d '{}' -e 127.0.0.1:10001
//  [Status]: Success
//  {
//      "message": "two"
//  }
message Request{

}

message Response{
    string message = 1;
}

service One {
    rpc One (Request) returns (Response) {}
}

service Two {
    rpc Two (Request) returns (Response) {}
}

and fail using -transport TTHeader

//  kitexcall -idl-path  idl/echo.proto -m One/Two -d '{}' -e 127.0.0.1:10001 -transport TTHeader
//  [Status]: Failed
//  [ServerError]: RPC call failed: remote or network error: default codec read failed: EOF peer close

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/jkskj/multiple
  2. run main.go
  3. Command kitexcall -idl-path idl/echo.proto -m One/Two -d '{}' -e 127.0.0.1:10001

Expected behavior

Screenshots

Kitex version:

v0.10.1

Environment:

Additional context

I also test other cases and record in https://github.com/jkskj/multiple/blob/main/main.go ,maybe useful for https://github.com/kitex-contrib/kitexcall/issues/7 and https://github.com/kitex-contrib/kitexcall/issues/8 .

YangruiEmma commented 1 month ago

Yes, currently it does not support multi service, it is in our plan if there are not many methods, it is recommended to define methods in one service