gRPC support

443 views
Skip to first unread message

Stuart Douglas

unread,
Nov 6, 2019, 9:34:57 PM11/6/19
to Quarkus Development mailing list
So I just thought I would create a topic to discuss gRPC and how to implement it. I think there are two routes we can go with here:

1) Create a vertx-grpc extension

This appears to be a wrapper around the normal Netty based gRPC server, that can re-use the Vert.x event loops. It does not appear to be able to share the underlying socket though, so it could not integrate with our existing HTTP later as it integrates at a Netty layer rather than the HTTP handler layer.

This approach uses the standard protobuf IDL generated code approach, so it does need a bit of setup in the build, and we would need to add something to dev mode to allow IDL's to be auth recompiled on change.

This seems like the path of least resistance, but I am not sure if it really gives the best 'Quarkified` user experience.

2) Implement our own on top of vert.x HTTP handlers

I actually did this for Undertow a while back and it was not super difficult, although I did re-use all the existing protobuf stuff. All gRPC requests can be identified by their content type, so this could just be a filter on our existing HTTP stack. 

We could also look at doing a non-IDL based approach where you can just annotate classes (e.g. Protostuff https://protostuff.github.io/docs/protostuff-runtime/

3) Do both, implement 1) first as it is the path of least resistance, and then look at also supporting an annotation based approach that would integrate with our existing HTTP stack when we have a bit more time.

Are there any other options I have not considered?

My preference would be to just use vertx-grpc for now, and then see if there is demand for an annotation based design in the future.

Stuart Douglas

unread,
Nov 6, 2019, 10:29:53 PM11/6/19
to Quarkus Development mailing list
Actually something I just realised is that the protobuf compiler is a native binary, so integrating it into dev mode might be tricky. 

Harald Pehl

unread,
Nov 7, 2019, 2:28:21 AM11/7/19
to sdou...@redhat.com, Quarkus Development mailing list
I started [1], [2] a while ago, but wasn’t able to push this further due to lack of time. It’s based on Netty and comes with a server and client extension plus a small quickstart. Basically SSL and dev mode support are missing.

Now that Quarkus 1.0 is out, I could update the extensions and try to add the missing parts. 

// Harald
-- 
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/71f2a0e4-4dc5-40ae-beca-712145573381%40googlegroups.com.

Stephane Epardaud

unread,
Nov 7, 2019, 3:06:07 AM11/7/19
to sdou...@redhat.com, Quarkus Development mailing list
1) Sounds like a good plan for a start.

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.


--
Stéphane Épardaud

Emmanuel Bernard

unread,
Nov 7, 2019, 6:14:49 AM11/7/19
to Stuart Douglas, Quarkus Development mailing list

We need the IDL option to support the ecosystem that is IDL driven. Unfortunately the classes are likely used in the app itself so that's a annotation processor thing. Unless I'm mistaken.

--

Emmanuel Bernard

unread,
Nov 7, 2019, 6:15:39 AM11/7/19
to Stuart Douglas, Quarkus Development mailing list

Does 1 cover gRPC clients? It's equally important. Or are all clients also servers?

On 7 Nov 2019, at 3:34, Stuart Douglas wrote:

--

clement escoffier

unread,
Nov 7, 2019, 8:26:49 AM11/7/19
to Stuart Douglas, eber...@redhat.com, Quarkus Development mailing list
On 7 Nov 2019 at 12:15 +0100, Emmanuel Bernard <eber...@redhat.com>, wrote:

Does 1 cover gRPC clients? It's equally important. Or are all clients also servers? 



We would need to integrate the proto to class generation in our build system (and allows hot reload). 


Clement



Harald Pehl

unread,
Nov 7, 2019, 10:00:13 AM11/7/19
to clement....@gmail.com, Stuart Douglas, Emmanuel Bernard, Quarkus Development mailing list
I've updated the existing gRPC extensions [1], [2] and the gRPC quickstart [3] to Quarkus 1.0.0.CR1.

The gRPC server extension supports to annotate gRPC services and intercceptors. Currently it starts its own gRPC server (io.grpc.Server), but integration with the new HTTP layer / Vert.x should be possible.

The gRPC client extension supports to inject channels to talk to gRPC services. 

What's missing is native support for the gRPC client extension and better dev mode support. 

I don't mind if you want to start over and write an own gRPC extension based on Vert.x gRPC. Just wanted to offer my support here. 

Thanks 
Harald


Stuart Douglas

unread,
Nov 7, 2019, 9:50:27 PM11/7/19
to Quarkus Development mailing list


On Friday, 8 November 2019 02:00:13 UTC+11, Harald Pehl wrote:
I've updated the existing gRPC extensions [1], [2] and the gRPC quickstart [3] to Quarkus 1.0.0.CR1.

The gRPC server extension supports to annotate gRPC services and intercceptors. Currently it starts its own gRPC server (io.grpc.Server), but integration with the new HTTP layer / Vert.x should be possible.

The gRPC client extension supports to inject channels to talk to gRPC services. 

What's missing is native support for the gRPC client extension and better dev mode support. 

I don't mind if you want to start over and write an own gRPC extension based on Vert.x gRPC. Just wanted to offer my support here. 

I think Vert.x gRPC is very similar, AFAIK it mostly just lets you re-use the vert.x event loop with the normal gRPC server. They have not directly implemented the protocol in Vert.x.

 
To unsubscribe from this group and stop receiving emails from it, send an email to quark...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quark...@googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quark...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages