On Tue, Jun 14, 2022 at 6:39 PM Doug DesCombaz <[email protected]> wrote:
> Some issues: > 1) I don't think I can use the NettyServerBuilder() because it expects a > shadowed version of the event loops. In other words, the GRPC project > brings in the Netty code and repackages, so many classes can't be used > back-and-forth. > That's if you are using grpc-netty-shaded. The grpc-netty artifact doesn't shade Netty, so you can share event loops. 2) The NettyServerHandler > <https://github.com/grpc/grpc-java/blob/master/netty/src/main/java/io/grpc/netty/NettyServerHandler.java> > isn't > exposed in the package. > And if it were it wouldn't really be useful. It is still using the old monolithic callback-based Netty HTTP/2 API so can't intermix with other HTTP handlers for the same connection. I don't think we'll ever go the Http2MultiplexCodec route, but getting on the Http2FrameCodec would allow some of these things to be possible. Although it would still take some redesign/refactoring in gRPC as RPC handling is intermixed with connection handling. To make something where you would implement your service using Netty APIs would essentially end up as a rewrite. Some possibilities: > 1) I think it would be possible if I forked the grpc-java: /netty... code. > Probably expose the underlying Context/Channel/Pipelines to the generated > service stub. Maybe, but also not too trivial. > 2) Ultimately, I can just run two servers, and send it over a socket, but I > was hoping to not add a hop. > 3) Any other ideas ? > Port sharing is not really in the cards right now. If you tried to fork the code I think you'd discover rapidly its architecture is vastly different from what you're searching for. You could use LocalChannel instead of having a second socket, but the gRPC code would still be expecting HTTP/2 frames. Making a gRPC server that only handles the RPC stuff isn't that hard of an affair. It wouldn't be all that bad for someone to make a gRPC Netty handler to use in Netty-based applications. -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CA%2B4M1oNK-BNzBhABS3vbtHa6XyOtqb0vAZHC546%3Dh%2BdR0aeJSA%40mail.gmail.com.
smime.p7s
Description: S/MIME Cryptographic Signature
