-1

Some background first: I have a system in which client hits the API to get some resources. The API call a microservice to get the required data. The job of API is to finally send a json string (constructed from data obtained from microservice) to client

The client is a legacy system which expects application/json.However, I want the API and microservice to talk using application-x-protobuf over http.

My question is does it make sense to convert my proto java file to string in the microservice itself and then send it to API ? Or does that defeat the purpose of using proto?

Is it necessary to send a proto java file over the wire, rather than a string converted from proto java file (JsonFormat.printer().print(myprotofile)) for leveraging the speed of protobuf ?

Manas Saxena
  • 2,171
  • 6
  • 39
  • 58

1 Answers1

0

The purpose of protobuf is to be faster and smaller than JSON. If the system you send the information to can't work with them then there is no point bothering with protobuf in the first place.

unit_1
  • 48
  • 1
  • 7