Skip to content

Commit 0569485

Browse files
alesjozangunalp
authored andcommitted
Upgrade to gRPC v4
Pulsar IT updated to include both proto v3 and proto v4 classes
1 parent 9891318 commit 0569485

File tree

23 files changed

+464
-34
lines changed

23 files changed

+464
-34
lines changed

bom/application/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<resteasy-microprofile.version>3.0.1.Final</resteasy-microprofile.version>
3030
<resteasy-spring-web.version>3.2.0.Final</resteasy-spring-web.version>
3131
<resteasy.version>6.2.12.Final</resteasy.version>
32-
<opentelemetry-instrumentation.version>2.10.0-alpha</opentelemetry-instrumentation.version>
32+
<opentelemetry-instrumentation.version>2.12.0-alpha</opentelemetry-instrumentation.version>
3333
<opentelemetry-semconv.version>1.29.0-alpha</opentelemetry-semconv.version>
3434
<quarkus-http.version>5.3.5</quarkus-http.version>
3535
<micrometer.version>1.14.7</micrometer.version><!-- keep in sync with hdrhistogram: https://central.sonatype.com/artifact/io.micrometer/micrometer-core -->

bom/test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<rxjava1.version>1.3.8</rxjava1.version>
2323
<strimzi-test-container.version>0.112.0</strimzi-test-container.version>
2424

25-
<opentelemetry-proto.version>1.3.2-alpha</opentelemetry-proto.version>
25+
<opentelemetry-proto.version>1.5.0-alpha</opentelemetry-proto.version>
2626
</properties>
2727

2828
<dependencyManagement>

extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcCommonProcessor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import io.quarkus.deployment.annotations.BuildProducer;
44
import io.quarkus.deployment.annotations.BuildStep;
55
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
6+
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
67

78
/**
89
* A processor used for both client and server
@@ -20,4 +21,9 @@ public class GrpcCommonProcessor {
2021
void indexGrpcStub(BuildProducer<IndexDependencyBuildItem> index) {
2122
index.produce(new IndexDependencyBuildItem("io.quarkus", "quarkus-grpc-stubs"));
2223
}
24+
25+
@BuildStep
26+
void runtimeInitialize(BuildProducer<RuntimeInitializedClassBuildItem> producer) {
27+
producer.produce(new RuntimeInitializedClassBuildItem("com.google.protobuf.JavaFeaturesProto"));
28+
}
2329
}

extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/grpc/GrpcTracingServerInterceptor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import java.net.SocketAddress;
77
import java.util.Collections;
88

9-
import javax.annotation.Nullable;
10-
119
import jakarta.inject.Singleton;
1210

1311
import io.grpc.ForwardingServerCall.SimpleForwardingServerCall;
@@ -88,14 +86,14 @@ public Integer getServerPort(GrpcRequest grpcRequest) {
8886

8987
@Override
9088
public InetSocketAddress getNetworkLocalInetSocketAddress(
91-
GrpcRequest grpcRequest, @Nullable Status status) {
89+
GrpcRequest grpcRequest, Status status) {
9290
// TODO: later version introduces TRANSPORT_ATTR_LOCAL_ADDR, might be a good idea to use it
9391
return null;
9492
}
9593

9694
@Override
9795
public InetSocketAddress getNetworkPeerInetSocketAddress(
98-
GrpcRequest request, @Nullable Status status) {
96+
GrpcRequest request, Status status) {
9997
SocketAddress address = request.getPeerSocketAddress();
10098
if (address instanceof InetSocketAddress) {
10199
return (InetSocketAddress) address;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
We need jar from this module to test supporting protos from external jars in grpc-external-proto-test
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>quarkus-integration-tests-parent</artifactId>
7+
<groupId>io.quarkus</groupId>
8+
<version>999-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>quarkus-integration-test-grpc-proto3</artifactId>
13+
<name>Quarkus - Integration Tests - gRPC - Proto v3</name>
14+
15+
<properties>
16+
<protoc.version>3.25.5</protoc.version>
17+
</properties>
18+
19+
<!-- Override to v3 -->
20+
<dependencyManagement>
21+
<dependencies>
22+
<dependency>
23+
<groupId>com.google.protobuf</groupId>
24+
<artifactId>protobuf-bom</artifactId>
25+
<version>${protoc.version}</version>
26+
<type>pom</type>
27+
<scope>import</scope>
28+
</dependency>
29+
<dependency>
30+
<groupId>com.google.protobuf</groupId>
31+
<artifactId>protoc</artifactId>
32+
<classifier>linux-aarch_64</classifier>
33+
<type>exe</type>
34+
<version>${protoc.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>com.google.protobuf</groupId>
38+
<artifactId>protoc</artifactId>
39+
<classifier>linux-ppcle_64</classifier>
40+
<type>exe</type>
41+
<version>${protoc.version}</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>com.google.protobuf</groupId>
45+
<artifactId>protoc</artifactId>
46+
<classifier>linux-s390_64</classifier>
47+
<type>exe</type>
48+
<version>${protoc.version}</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>com.google.protobuf</groupId>
52+
<artifactId>protoc</artifactId>
53+
<classifier>linux-x86_32</classifier>
54+
<type>exe</type>
55+
<version>${protoc.version}</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>com.google.protobuf</groupId>
59+
<artifactId>protoc</artifactId>
60+
<classifier>linux-x86_64</classifier>
61+
<type>exe</type>
62+
<version>${protoc.version}</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>com.google.protobuf</groupId>
66+
<artifactId>protoc</artifactId>
67+
<classifier>osx-aarch_64</classifier>
68+
<type>exe</type>
69+
<version>${protoc.version}</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>com.google.protobuf</groupId>
73+
<artifactId>protoc</artifactId>
74+
<classifier>osx-x86_64</classifier>
75+
<type>exe</type>
76+
<version>${protoc.version}</version>
77+
</dependency>
78+
<dependency>
79+
<groupId>com.google.protobuf</groupId>
80+
<artifactId>protoc</artifactId>
81+
<classifier>windows-x86_32</classifier>
82+
<type>exe</type>
83+
<version>${protoc.version}</version>
84+
</dependency>
85+
<dependency>
86+
<groupId>com.google.protobuf</groupId>
87+
<artifactId>protoc</artifactId>
88+
<classifier>windows-x86_64</classifier>
89+
<type>exe</type>
90+
<version>${protoc.version}</version>
91+
</dependency>
92+
</dependencies>
93+
</dependencyManagement>
94+
95+
<dependencies>
96+
<!-- GRPC for Protobuf -->
97+
<dependency>
98+
<groupId>io.quarkus</groupId>
99+
<artifactId>quarkus-grpc-common</artifactId>
100+
</dependency>
101+
<dependency>
102+
<groupId>io.quarkus</groupId>
103+
<artifactId>quarkus-grpc-codegen</artifactId>
104+
</dependency>
105+
<dependency>
106+
<groupId>io.grpc</groupId>
107+
<artifactId>grpc-api</artifactId>
108+
</dependency>
109+
<dependency>
110+
<groupId>io.quarkus</groupId>
111+
<artifactId>quarkus-grpc-stubs</artifactId>
112+
</dependency>
113+
114+
<!-- Minimal test dependencies to *-deployment artifacts for consistent build order -->
115+
<dependency>
116+
<groupId>io.quarkus</groupId>
117+
<artifactId>quarkus-grpc-common-deployment</artifactId>
118+
<version>${project.version}</version>
119+
<type>pom</type>
120+
<scope>test</scope>
121+
<exclusions>
122+
<exclusion>
123+
<groupId>*</groupId>
124+
<artifactId>*</artifactId>
125+
</exclusion>
126+
</exclusions>
127+
</dependency>
128+
</dependencies>
129+
130+
<build>
131+
<plugins>
132+
<plugin>
133+
<groupId>io.quarkus</groupId>
134+
<artifactId>quarkus-maven-plugin</artifactId>
135+
<executions>
136+
<execution>
137+
<goals>
138+
<goal>generate-code</goal>
139+
<goal>build</goal>
140+
</goals>
141+
</execution>
142+
</executions>
143+
</plugin>
144+
</plugins>
145+
</build>
146+
147+
<!-- Workaround duplicate sources artifact -->
148+
<profiles>
149+
<profile>
150+
<id>test-pulsar</id>
151+
<activation>
152+
<property>
153+
<name>native</name>
154+
</property>
155+
</activation>
156+
<build>
157+
<plugins>
158+
<plugin>
159+
<artifactId>maven-source-plugin</artifactId>
160+
<configuration>
161+
<skipSource>true</skipSource>
162+
</configuration>
163+
</plugin>
164+
</plugins>
165+
</build>
166+
</profile>
167+
</profiles>
168+
169+
</project>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ option objc_class_prefix = "HLW";
77

88
package helloworld;
99

10-
service Greeter {
11-
rpc SayHello (HelloRequest) returns (HelloReply) {}
10+
service Hello {
11+
rpc SayHello (HelloRequest) returns (HelloReply) {}
1212
}
1313

1414
message HelloRequest {

integration-tests/grpc-proto3/src/main/resources/META-INF/beans.xml

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
We need jar from this module to test supporting protos from external jars in grpc-external-proto-test
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>quarkus-integration-tests-parent</artifactId>
7+
<groupId>io.quarkus</groupId>
8+
<version>999-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>quarkus-integration-test-grpc-proto4</artifactId>
13+
<name>Quarkus - Integration Tests - gRPC - Proto v3</name>
14+
15+
<dependencies>
16+
<!-- GRPC for Protobuf -->
17+
<dependency>
18+
<groupId>io.quarkus</groupId>
19+
<artifactId>quarkus-grpc-codegen</artifactId>
20+
</dependency>
21+
<dependency>
22+
<groupId>io.quarkus</groupId>
23+
<artifactId>quarkus-grpc-common</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>io.grpc</groupId>
27+
<artifactId>grpc-api</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>io.quarkus</groupId>
31+
<artifactId>quarkus-grpc-stubs</artifactId>
32+
</dependency>
33+
34+
<!-- Minimal test dependencies to *-deployment artifacts for consistent build order -->
35+
<dependency>
36+
<groupId>io.quarkus</groupId>
37+
<artifactId>quarkus-grpc-common-deployment</artifactId>
38+
<version>${project.version}</version>
39+
<type>pom</type>
40+
<scope>test</scope>
41+
<exclusions>
42+
<exclusion>
43+
<groupId>*</groupId>
44+
<artifactId>*</artifactId>
45+
</exclusion>
46+
</exclusions>
47+
</dependency>
48+
</dependencies>
49+
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>io.quarkus</groupId>
54+
<artifactId>quarkus-maven-plugin</artifactId>
55+
<executions>
56+
<execution>
57+
<goals>
58+
<goal>generate-code</goal>
59+
<goal>build</goal>
60+
</goals>
61+
</execution>
62+
</executions>
63+
</plugin>
64+
</plugins>
65+
</build>
66+
67+
<!-- Workaround duplicate sources artifact -->
68+
<profiles>
69+
<profile>
70+
<id>test-pulsar</id>
71+
<activation>
72+
<property>
73+
<name>native</name>
74+
</property>
75+
</activation>
76+
<build>
77+
<plugins>
78+
<plugin>
79+
<artifactId>maven-source-plugin</artifactId>
80+
<configuration>
81+
<skipSource>true</skipSource>
82+
</configuration>
83+
</plugin>
84+
</plugins>
85+
</build>
86+
</profile>
87+
</profiles>
88+
89+
</project>

0 commit comments

Comments
 (0)