directly support grpc-web
it would be great to support grpc-web with an in-process proxy instead of using a real proxy in between the frontend and the backend to translate grpc-web->proxy->grpc-server. direct communication support instead would be a great feature
I will have a look at this, but it might take some time.
@mwelser I have a few questions regarding the implementation of this feature.
- First of all, what do you expect to send to/receive from the server: JSON (any supported format by Spring) or Protobuf bytes?
- I assume the former.
- Which processing route do you expect the request to take:
- Web-Filter -> gRPC-Client -> gRPC-Server -> gRPC-Server-Interceptors -> gRPC-Service
- Web-Filter -> gRPC-Service
- The main difference is that in the first case the request would take the usual gRPC processing route and would thus trigger the usual tracing, metrics and maybe gRPC authentication. However in that case it would be routed to both the web filters and the grpc interceptors, which might be confusing especially for security related stuff. I would recommend the second option.
- How should streaming calls be handled?
- With lists of input/output data?
@mwelser I started the implementation in #207 . The PR is WIP, but it should be functional at least for simple use cases. Any feedback would be appreciated.
It is not likely that the feature will make it into the upcoming release 2.3.0 though.
Server enabled Security, configure SSL why prompt “Security is enabled but this implementation does not support Security! ”?
See also: https://mvnrepository.com/artifact/io.grpc/grpc-servlet
Hi. I want to implement in-process proxy for grpc-web, but I can't figure out how to. Can you provide more information?
I'm not sure what exactly you are asking for.
- Web-Request -> grpc-servlet ->
@GrpcService - or Web-Request -> RestController -> InProcessChannel -> InProcessServer ->
@GrpcService
I'm trying first way. How can I use grpc-servlet with grpc-spring-boot-starter? Despite it neglected for 3 years, does GrpcServlet works well? GrpcServlet requires all services and their urlPatterns. Should I pass all my service information manually? Is there a way to use netty instead of servlet using NettyServerBuilder?
Despite it neglected for 3 years, does GrpcServlet works well?
AFAICT it was only added this year?
https://github.com/grpc/grpc-java/commits/master/servlet
GrpcServlet requires all services and their urlPatterns.
I dont see a way to configure urls:
https://github.com/grpc/grpc-java/blob/478f30e6458a72957106b44657608b9cd4ee6c1b/servlet/src/main/java/io/grpc/servlet/GrpcServlet.java#L53
Should I pass all my service information manually?
As for finding all your services you can leave that to the https://github.com/yidongnan/grpc-spring-boot-starter/blob/72159342ca2001a596cf32b4eb456478156eefbb/grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/service/GrpcServiceDiscoverer.java#L32 bean.
Is there a way to use netty instead of servlet using NettyServerBuilder?
Not via Netty Server Builder Afaict but with whatever means this code uses: https://github.com/grpc/grpc-java/blob/478f30e6458a72957106b44657608b9cd4ee6c1b/servlet/src/main/java/io/grpc/servlet/ServletServerBuilder.java#L100
Not sure if that actually starts a server or only the adapter. You might need a netty servlet dependency as well.