Integration of H3 gRPC MP Implementation into H4. gRPC in H3 MP started its own Netty-based server on a new port, the new implementation in H4 is fully intergrated with the web server, which is now capable of detecting the type of a connection and route its data to the correct handler. As a result of this new integration, there is new gRPC server configuration (there is no gRPC server anymore) and a few other integration points have changed.
Module Changes
New helidon-microprofile-grpc-core module
New helidon-microprofile-grpc-server module
Additions and updates to helidon-grpc-core and helidon-webserver-grpc modules
gRPC MP Support
Just like in H3, there is now support for gRPC annotated endpoints:
In addition to annotated endpoints, the gRPC CDI extension will scan and automatically register any beans that implement GrpcService (from SE) and BindableService (io.grpc), just like it did in H3.
Server interceptors from the io.grpc API are support only on annotated types either by direct reference using the @GrpcInterceptors or via CDI name binding.
@Grpc
@ApplicationScoped
@EchoInterceptorBinding // name binding
@GrpcInterceptors(EchoInterceptor1.class) // direct reference
public static class EchoService { ... }
@GrpcInterceptor
@ApplicationScoped
public static class EchoInterceptor1 implements ServerInterceptor {
@Override
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call,
Metadata headers,
ServerCallHandler<ReqT, RespT> next) {
...
}
}
@GrpcInterceptor
@EchoInterceptorBinding
@ApplicationScoped
public static class EchoInterceptor2 implements ServerInterceptor {
@Override
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call,
Metadata headers,
ServerCallHandler<ReqT, RespT> next) {
...
}
}
Additional Features in PR
The GrpcMpContext SPI has also been ported to H4. It enables users to write CDI extensions that are given access to the CDI BeanManager and the server's GrpcRouting builder.
A Context interceptor is automatically registered for all annotated endpoints
A Tracing intercetptro is registered for all annotated endpoints if grpc.tracing.enabled is set to true (defaults tofalse)
Description
Integration of H3 gRPC MP Implementation into H4. gRPC in H3 MP started its own Netty-based server on a new port, the new implementation in H4 is fully intergrated with the web server, which is now capable of detecting the type of a connection and route its data to the correct handler. As a result of this new integration, there is new gRPC server configuration (there is no gRPC server anymore) and a few other integration points have changed.
Module Changes
gRPC MP Support
Just like in H3, there is now support for gRPC annotated endpoints:
In addition to annotated endpoints, the gRPC CDI extension will scan and automatically register any beans that implement
GrpcService
(from SE) andBindableService
(io.grpc), just like it did in H3.Server interceptors from the io.grpc API are support only on annotated types either by direct reference using the
@GrpcInterceptors
or via CDI name binding.Additional Features in PR
GrpcMpContext
SPI has also been ported to H4. It enables users to write CDI extensions that are given access to the CDIBeanManager
and the server'sGrpcRouting
builder.grpc.tracing.enabled
is set totrue
(defaults tofalse
)