custom transport grpc java

94 views
Skip to first unread message

Avinash Lakshman

unread,
Nov 1, 2020, 1:33:03 PM11/1/20
to grpc.io
Folks

Any advice/literature as to how one could replace netty with a custom implementation for grpc java? Thanks in advance.

Regards
Avinash

Eric Anderson

unread,
Nov 2, 2020, 4:18:21 PM11/2/20
to Avinash Lakshman, grpc.io
There's not too much, but we can give you pointers. The transport API is internal and we don't support out-of-tree custom transports. If you have a need for a custom transport, 1) I'd first double-check that there is a serious need, as creating a new transport is involved and 2) would suggest it to be developed in tight coordination with us. I will note that many times a custom transport is not necessary, but it depends on what your needs are.

What are you needing a custom transport for? Client-side and/or server-side?

--
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 grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/8ae63d8d-a0c1-48a2-857b-1a4214a3159an%40googlegroups.com.

Avinash Lakshman

unread,
Nov 3, 2020, 1:39:27 AM11/3/20
to Eric Anderson, grpc.io
Thanks for the response Eric. I was just looking at this as an academic exercise given the literature says that the transport is pluggable. Yes I would be looking at the client and server side.

Regards
Avinash

Eric Anderson

unread,
Nov 3, 2020, 1:53:09 PM11/3/20
to Avinash Lakshman, grpc.io
On Mon, Nov 2, 2020 at 10:39 PM Avinash Lakshman <avinash....@gmail.com> wrote:
I was just looking at this as an academic exercise given the literature says that the transport is pluggable.

What literature is that?

Yes I would be looking at the client and server side.

So transport is pluggable in two ways: 1) you can implement ManagedChannel and Server directly or 2) you can use ManagedChannelImpl and ServerImpl as utilities and then implement the transport that they expect. (1) basically implements "all the hard parts of gRPC". (2) is still involved, but some things like load balancing and service config would be handled for you. (2) is typically what we mean by "implementing a transport".

The precise details change a bit depending on what type of transport you want to implement. For example, InProcess is dramatically different than OkHttp and Netty. What transport do you want to implement?
Reply all
Reply to author
Forward
0 new messages