Skip to content

Commit 70d434d

Browse files
thegridmantomas-langer
authored andcommitted
gRPC microprofile support (helidon-io#910)
* gRPC microprofile support (helidon-io#107) Adding gRPC microprofile support * Resolve review comments, checkstyle and spot-bugs issues * Fixing copyright * Rebasing on Oracle/Helidon master * Add support for CDI discovery of MarshallerSuppliers * Improve error logging * Rebasing on Oracle/Helidon master * Changes based on pull request feedback * Use Resource class for resources loaded from configuration * Refactoring based on pull request feedback * Use the standard protobuf Empty message type instead of a custom Empty message * Support CompletionStage as a return type in MP annotated gRPC service methods
1 parent 7086ed9 commit 70d434d

181 files changed

Lines changed: 16619 additions & 864 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bom/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,26 @@
116116
<artifactId>helidon-grpc-metrics</artifactId>
117117
<version>${helidon.version}</version>
118118
</dependency>
119+
<dependency>
120+
<groupId>io.helidon.microprofile.grpc</groupId>
121+
<artifactId>helidon-microprofile-grpc-core</artifactId>
122+
<version>${helidon.version}</version>
123+
</dependency>
124+
<dependency>
125+
<groupId>io.helidon.microprofile.grpc</groupId>
126+
<artifactId>helidon-microprofile-grpc-server</artifactId>
127+
<version>${helidon.version}</version>
128+
</dependency>
129+
<dependency>
130+
<groupId>io.helidon.microprofile.grpc</groupId>
131+
<artifactId>helidon-microprofile-grpc-metrics</artifactId>
132+
<version>${helidon.version}</version>
133+
</dependency>
134+
<dependency>
135+
<groupId>io.helidon.microprofile.grpc</groupId>
136+
<artifactId>helidon-microprofile-grpc-client</artifactId>
137+
<version>${helidon.version}</version>
138+
</dependency>
119139
<!-- media -->
120140
<dependency>
121141
<groupId>io.helidon.media</groupId>

config/etcd/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@
6565
<groupId>io.grpc</groupId>
6666
<artifactId>grpc-protobuf</artifactId>
6767
</dependency>
68+
<dependency>
69+
<groupId>io.grpc</groupId>
70+
<artifactId>grpc-stub</artifactId>
71+
</dependency>
6872
<dependency>
6973
<groupId>com.google.protobuf</groupId>
7074
<artifactId>protobuf-java</artifactId>

config/etcd/src/main/java9/module-info.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
requires java.logging;
2323
requires transitive io.helidon.config;
2424
requires etcd4j;
25-
requires grpc.api;
26-
requires grpc.core;
25+
requires io.grpc;
2726
requires grpc.protobuf;
2827
requires grpc.stub;
2928
requires protobuf.java;

dependencies/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@
279279
</exclusion>
280280
</exclusions>
281281
</dependency>
282+
<dependency>
283+
<groupId>io.grpc</groupId>
284+
<artifactId>grpc-api</artifactId>
285+
<version>${version.lib.grpc}</version>
286+
</dependency>
282287
<dependency>
283288
<groupId>io.grpc</groupId>
284289
<artifactId>grpc-context</artifactId>

docs/src/main/docs/about/01_overview.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,11 @@ Expose health statuses of your applications.
106106
--
107107
Support OpenAPI from your application.
108108
--
109+
110+
[CARD]
111+
.gRPC
112+
[icon=swap_horiz,link=grpc/01_introduction.adoc]
113+
--
114+
Build gRPC servers and clients.
115+
--
109116
====

docs/src/main/docs/grpc/04_service_implementation.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
///////////////////////////////////////////////////////////////////////////////
1818
19-
= Service Implementation
19+
= gRPC Service Implementation
2020
:javadoc-base-url-api: {javadoc-base-url}?io/helidon/grpc/server
2121
:pagename: grpc-server-service-implementation
2222
:description: Helidon gRPC Service Implementation

docs/src/main/docs/grpc/05_interceptors.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
///////////////////////////////////////////////////////////////////////////////
1818
19-
= Interceptors
19+
= gRPC Interceptors
2020
:pagename: grpc-server-interceptors
2121
:description: Helidon gRPC Service Interceptors
2222
:keywords: helidon, grpc, java

docs/src/main/docs/grpc/06_health_checks.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
///////////////////////////////////////////////////////////////////////////////
1818
19-
= Service Health Checks
19+
= gRPC Service Health Checks
2020
:pagename: grpc-server-health-checks
2121
:description: Helidon gRPC Service Health Checks
2222
:keywords: helidon, grpc, java

docs/src/main/docs/grpc/07_metrics.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
///////////////////////////////////////////////////////////////////////////////
1818
19-
= Service Metrics
19+
= gRPC Service Metrics
2020
:pagename: grpc-server-metrics
2121
:description: Helidon gRPC Service Metrics
2222
:keywords: helidon, grpc, java

docs/src/main/docs/grpc/client/01_introduction.adoc renamed to docs/src/main/docs/grpc/21_client_introduction.adoc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ The class `GrpcServiceClient` acts as the client object for accessing a gRPC ser
3333
3434
In later sections in this document, you will see how to customize both `ClientServiceDescriptor` and the `Channel`.
3535
36+
== Maven Coordinates
37+
38+
The <<about/04_managing-dependencies.adoc, Managing Dependencies>> page describes how you
39+
should declare dependency management for Helidon applications. Then declare the following dependency in your project:
40+
41+
[source,xml]
42+
----
43+
<dependency>
44+
<groupId>io.helidon.grpc</groupId>
45+
<artifactId>helidon-grpc-client</artifactId> <!--1-->
46+
</dependency>
47+
----
48+
49+
<1> Declare dependency on Helidon gRPC Client.
50+
3651
== Quick Start
3752
3853
First, create and run a minimalist `HelloService` gRPC server application as described in the
@@ -74,18 +89,3 @@ requests and responses.
7489
7590
We will look into deployment of "standard" gRPC services that use Protobuf for request and response marshalling, as well as
7691
how you can configure custom marshallers, later in this document.
77-
78-
== Maven Coordinates
79-
80-
The <<getting-started/03_managing-dependencies.adoc, Getting Started>> page describes how you
81-
should declare dependency management for Helidon applications. Then declare the following dependency in your project:
82-
83-
[source,xml]
84-
----
85-
<dependency>
86-
<groupId>io.helidon.grpc</groupId>
87-
<artifactId>helidon-grpc-client</artifactId> <!--1-->
88-
</dependency>
89-
----
90-
91-
<1> Declare dependency on Helidon gRPC Client.

0 commit comments

Comments
 (0)