I am trying to write services that use both gRPC and REST. The implementing technologies are Java, Spring Boot and gRPC. An example usage scenario follows:
The intent is that there are external clients that may interact with the application via REST endpoints and/or by making gRPC calls. Internally, there are "gateway" services that provide the external interfaces and take care of transporting/routing requests and responses between the external clients and the "domain" services, that do the actual work. The internal services will communicate via gRPC.
The external client has no knowledge of how things are handled internally and the domain services have no external interfaces.
I have been able to get a basic request/response pattern to work from end-to-end, but am not sure how to implement patterns that involve streaming (in either direction). Actually, that's not entirely true - I have been able to get the basic examples provided on the gRPC site (https://grpc.io/) to work.
Here is an example of what I'm trying to do, that I can't seem to figure out how to make work:
The "domain" service has the ability to return a collection of objects (i.e. the stream source) to a requestor. The domain uses gRPC logic to provide these objects to the calling client (the "gateway" in this case). An external client makes a REST call to the gateway service to request the object collection that the domain service provides.
As far as I can tell, the domain and gateway talk to each other just fine, but there is a problem when it tries to send the information back to the external client. For specific details about the code and the errors I've been running into, please see related issue Problem returning stream of responses from gRPC service to RESTful client.
One question that comes to mind is: can REST be used to handle streaming of information (in either direction)? If it cannot, what options do I have, if any? If it can, how do I go about it?
UPDATE:
I have made updates to the referenced companion SO posting above.