if we switch from netty to okttp in a non-android project, is there any potential different?

265 views
Skip to first unread message

Grpc learner

unread,
Aug 16, 2018, 5:56:36 PM8/16/18
to grpc.io
If we are not building the Android software but regular java maven project for PC/Linux
what is different?



Eric Anderson

unread,
Aug 20, 2018, 10:58:08 AM8/20/18
to x...@autonomic.ai, grpc-io
grpc-okhttp works fine on regular, non-Android Java versions. Security is different than grpc-netty, so you can't use netty-tcnative. You can use Java 9+ or Conscrypt. If using Conscrypt, you should install it as the default provider with Security.insertProviderAt(Conscrypt.newProvider(), 1); before calling grpc. Netty uses non-blocking I/O via NIO whereas OkHttp uses blocking I/O with Input/OutputStreams. Thus each TCP connection with OkHttp will use 1-2 threads.

Why are you interested in using okhttp with non-Android?

On Thu, Aug 16, 2018 at 2:56 PM Grpc learner <x...@autonomic.ai> wrote:
If we are not building the Android software but regular java maven project for PC/Linux
what is different?



--
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 post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/1bd39209-2854-42d4-b077-3c94dfbb0e77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Grpc learner

unread,
Aug 21, 2018, 3:05:54 PM8/21/18
to grpc.io
Hi Eric,

Thank you so much for your reply!
We have some Solaris machine, in which seem we cannot use netty, so we would like to switch to okhttp.

Jasper Siepkes

unread,
Aug 21, 2018, 4:18:34 PM8/21/18
to grpc.io
Hi!

We run gRPC on SmartOS (ie. Illumos / Solaris based OS) on multiple production systems with Netty with no problems whatsoever. What kind of problems are you experiencing on Solaris and which version of Solaris are you running?

Kind regards,

Jasper

Grpc learner

unread,
Aug 23, 2018, 2:46:28 PM8/23/18
to grpc.io
Hi Jasper,

Thanks for your reply!

The error we encounter was `Netty lib does not support Sparc64: could not load a native library: io_grpc_netty_shaded_netty_tcnative_sparc_64`

Did you encounter it before?

Eric Anderson

unread,
Aug 24, 2018, 10:25:24 AM8/24/18
to x...@autonomic.ai, grpc-io
On Thu, Aug 23, 2018 at 11:46 AM Grpc learner <x...@autonomic.ai> wrote:
The error we encounter was `Netty lib does not support Sparc64: could not load a native library: io_grpc_netty_shaded_netty_tcnative_sparc_64`

Ah, yes. We don't provide pre-build binaries for SPARC. But swapping to OkHttp doesn't really help the situation.

If you need SSL/TLS, you will need to use Java 9+ or build Conscript or netty-tcnative manually. It's also possible to use Jetty ALPN boot, but we generally discourage it because it can produce really weird failures when misconfigured. But in your case it may be the easiest.
Reply all
Reply to author
Forward
0 new messages