Problem returning stream of responses from gRPC service to RESTful client

后端 未结 2 1028
时光说笑
时光说笑 2021-01-14 16:58

I am attempting to write a set of services that will provide a REST interface to external clients, while using gRPC/protobuf for inter-service communication internally. Spri

相关标签:
2条回答
  • 2021-01-14 17:41

    In may case i have: .... response.setMessageCode(0).setResponseMessage("string message"); .... that never return to client.

    I change this to: ... APIResponse response = APIResponse.newBuilder().setResponseMessage(localidad.toString()).build(); ...

    Without ".setMessageCode(0)"... and it works!

    0 讨论(0)
  • 2021-01-14 17:53

    According to the Gateway log, it looks like jackson is having trouble converting proto to json.

    can you try com.googlecode.protobuf.format.JsonFormat? I am not spring user, but there should be API for custom serialization. or, you can add custom serialization to jackson using JsonFormat but it sounds little weird.

    0 讨论(0)
提交回复
热议问题