Skip to content

Commit f42a742

Browse files
author
Alexander Furer
committed
closes #67, release 2.1.4 #
1 parent d1c2e3b commit f42a742

File tree

6 files changed

+98
-57
lines changed

6 files changed

+98
-57
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repositories {
1919
2020
}
2121
dependencies {
22-
compile('org.lognet:grpc-spring-boot-starter:2.1.3')
22+
compile('org.lognet:grpc-spring-boot-starter:2.1.4')
2323
}
2424
----
2525

ReleaseNotes.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
== Version 2.1.4
2+
- gRPC version upgraded to 1.8.0
3+
14
== Version 2.1.3
25
- Random gRPC server port support
36
- Fixed wrong interceptors ordering bug.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
buildscript {
33
ext {
44
springBootVersion = '1.5.8.RELEASE'
5-
grpcVersion = '1.7.0'
5+
grpcVersion = '1.8.0'
66
}
77
repositories {
88
mavenCentral()

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=2.1.4-SNAPSHOT
1+
version=2.1.4
22
#group=io.github.lognet
33
group=org.lognet
44
description=Spring Boot starter for Google RPC.

grpc-spring-boot-starter-demo/src/main/protoGen/io/grpc/examples/CalculatorGrpc.java

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
package io.grpc.examples;
22

3-
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
4-
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
5-
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
3+
import static io.grpc.MethodDescriptor.generateFullMethodName;
64
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
7-
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
5+
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
6+
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
7+
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9+
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
910
import static io.grpc.stub.ClientCalls.futureUnaryCall;
10-
import static io.grpc.MethodDescriptor.generateFullMethodName;
11-
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
12-
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
13-
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
1411
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
15-
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
12+
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
13+
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
14+
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
1615
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
16+
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
1717

1818
/**
1919
*/
2020
@javax.annotation.Generated(
21-
value = "by gRPC proto compiler (version 1.7.0)",
21+
value = "by gRPC proto compiler (version 1.8.0)",
2222
comments = "Source: calculator.proto")
2323
public final class CalculatorGrpc {
2424

@@ -28,18 +28,37 @@ private CalculatorGrpc() {}
2828

2929
// Static method descriptors that strictly reflect the proto.
3030
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
31+
@java.lang.Deprecated // Use {@link #getCalculateMethod()} instead.
3132
public static final io.grpc.MethodDescriptor<io.grpc.examples.CalculatorOuterClass.CalculatorRequest,
32-
io.grpc.examples.CalculatorOuterClass.CalculatorResponse> METHOD_CALCULATE =
33-
io.grpc.MethodDescriptor.<io.grpc.examples.CalculatorOuterClass.CalculatorRequest, io.grpc.examples.CalculatorOuterClass.CalculatorResponse>newBuilder()
34-
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
35-
.setFullMethodName(generateFullMethodName(
36-
"Calculator", "Calculate"))
37-
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
38-
io.grpc.examples.CalculatorOuterClass.CalculatorRequest.getDefaultInstance()))
39-
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
40-
io.grpc.examples.CalculatorOuterClass.CalculatorResponse.getDefaultInstance()))
41-
.setSchemaDescriptor(new CalculatorMethodDescriptorSupplier("Calculate"))
42-
.build();
33+
io.grpc.examples.CalculatorOuterClass.CalculatorResponse> METHOD_CALCULATE = getCalculateMethod();
34+
35+
private static volatile io.grpc.MethodDescriptor<io.grpc.examples.CalculatorOuterClass.CalculatorRequest,
36+
io.grpc.examples.CalculatorOuterClass.CalculatorResponse> getCalculateMethod;
37+
38+
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
39+
public static io.grpc.MethodDescriptor<io.grpc.examples.CalculatorOuterClass.CalculatorRequest,
40+
io.grpc.examples.CalculatorOuterClass.CalculatorResponse> getCalculateMethod() {
41+
io.grpc.MethodDescriptor<io.grpc.examples.CalculatorOuterClass.CalculatorRequest, io.grpc.examples.CalculatorOuterClass.CalculatorResponse> getCalculateMethod;
42+
if ((getCalculateMethod = CalculatorGrpc.getCalculateMethod) == null) {
43+
synchronized (CalculatorGrpc.class) {
44+
if ((getCalculateMethod = CalculatorGrpc.getCalculateMethod) == null) {
45+
CalculatorGrpc.getCalculateMethod = getCalculateMethod =
46+
io.grpc.MethodDescriptor.<io.grpc.examples.CalculatorOuterClass.CalculatorRequest, io.grpc.examples.CalculatorOuterClass.CalculatorResponse>newBuilder()
47+
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
48+
.setFullMethodName(generateFullMethodName(
49+
"Calculator", "Calculate"))
50+
.setSampledToLocalTracing(true)
51+
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
52+
io.grpc.examples.CalculatorOuterClass.CalculatorRequest.getDefaultInstance()))
53+
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
54+
io.grpc.examples.CalculatorOuterClass.CalculatorResponse.getDefaultInstance()))
55+
.setSchemaDescriptor(new CalculatorMethodDescriptorSupplier("Calculate"))
56+
.build();
57+
}
58+
}
59+
}
60+
return getCalculateMethod;
61+
}
4362

4463
/**
4564
* Creates a new async stub that supports all call types for the service
@@ -72,13 +91,13 @@ public static abstract class CalculatorImplBase implements io.grpc.BindableServi
7291
*/
7392
public void calculate(io.grpc.examples.CalculatorOuterClass.CalculatorRequest request,
7493
io.grpc.stub.StreamObserver<io.grpc.examples.CalculatorOuterClass.CalculatorResponse> responseObserver) {
75-
asyncUnimplementedUnaryCall(METHOD_CALCULATE, responseObserver);
94+
asyncUnimplementedUnaryCall(getCalculateMethod(), responseObserver);
7695
}
7796

7897
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
7998
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
8099
.addMethod(
81-
METHOD_CALCULATE,
100+
getCalculateMethod(),
82101
asyncUnaryCall(
83102
new MethodHandlers<
84103
io.grpc.examples.CalculatorOuterClass.CalculatorRequest,
@@ -111,7 +130,7 @@ protected CalculatorStub build(io.grpc.Channel channel,
111130
public void calculate(io.grpc.examples.CalculatorOuterClass.CalculatorRequest request,
112131
io.grpc.stub.StreamObserver<io.grpc.examples.CalculatorOuterClass.CalculatorResponse> responseObserver) {
113132
asyncUnaryCall(
114-
getChannel().newCall(METHOD_CALCULATE, getCallOptions()), request, responseObserver);
133+
getChannel().newCall(getCalculateMethod(), getCallOptions()), request, responseObserver);
115134
}
116135
}
117136

@@ -137,7 +156,7 @@ protected CalculatorBlockingStub build(io.grpc.Channel channel,
137156
*/
138157
public io.grpc.examples.CalculatorOuterClass.CalculatorResponse calculate(io.grpc.examples.CalculatorOuterClass.CalculatorRequest request) {
139158
return blockingUnaryCall(
140-
getChannel(), METHOD_CALCULATE, getCallOptions(), request);
159+
getChannel(), getCalculateMethod(), getCallOptions(), request);
141160
}
142161
}
143162

@@ -164,7 +183,7 @@ protected CalculatorFutureStub build(io.grpc.Channel channel,
164183
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.CalculatorOuterClass.CalculatorResponse> calculate(
165184
io.grpc.examples.CalculatorOuterClass.CalculatorRequest request) {
166185
return futureUnaryCall(
167-
getChannel().newCall(METHOD_CALCULATE, getCallOptions()), request);
186+
getChannel().newCall(getCalculateMethod(), getCallOptions()), request);
168187
}
169188
}
170189

@@ -252,7 +271,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
252271
if (result == null) {
253272
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
254273
.setSchemaDescriptor(new CalculatorFileDescriptorSupplier())
255-
.addMethod(METHOD_CALCULATE)
274+
.addMethod(getCalculateMethod())
256275
.build();
257276
}
258277
}

grpc-spring-boot-starter-demo/src/main/protoGen/io/grpc/examples/GreeterGrpc.java

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
package io.grpc.examples;
22

3-
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
4-
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
5-
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
3+
import static io.grpc.MethodDescriptor.generateFullMethodName;
64
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
7-
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
5+
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
6+
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
7+
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
88
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9+
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
910
import static io.grpc.stub.ClientCalls.futureUnaryCall;
10-
import static io.grpc.MethodDescriptor.generateFullMethodName;
11-
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
12-
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
13-
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
1411
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
15-
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
12+
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
13+
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
14+
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
1615
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
16+
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
1717

1818
/**
1919
* <pre>
2020
* The greeter service definition.
2121
* </pre>
2222
*/
2323
@javax.annotation.Generated(
24-
value = "by gRPC proto compiler (version 1.7.0)",
24+
value = "by gRPC proto compiler (version 1.8.0)",
2525
comments = "Source: greeter.proto")
2626
public final class GreeterGrpc {
2727

@@ -31,18 +31,37 @@ private GreeterGrpc() {}
3131

3232
// Static method descriptors that strictly reflect the proto.
3333
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
34+
@java.lang.Deprecated // Use {@link #getSayHelloMethod()} instead.
3435
public static final io.grpc.MethodDescriptor<io.grpc.examples.GreeterOuterClass.HelloRequest,
35-
io.grpc.examples.GreeterOuterClass.HelloReply> METHOD_SAY_HELLO =
36-
io.grpc.MethodDescriptor.<io.grpc.examples.GreeterOuterClass.HelloRequest, io.grpc.examples.GreeterOuterClass.HelloReply>newBuilder()
37-
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
38-
.setFullMethodName(generateFullMethodName(
39-
"Greeter", "SayHello"))
40-
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
41-
io.grpc.examples.GreeterOuterClass.HelloRequest.getDefaultInstance()))
42-
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
43-
io.grpc.examples.GreeterOuterClass.HelloReply.getDefaultInstance()))
44-
.setSchemaDescriptor(new GreeterMethodDescriptorSupplier("SayHello"))
45-
.build();
36+
io.grpc.examples.GreeterOuterClass.HelloReply> METHOD_SAY_HELLO = getSayHelloMethod();
37+
38+
private static volatile io.grpc.MethodDescriptor<io.grpc.examples.GreeterOuterClass.HelloRequest,
39+
io.grpc.examples.GreeterOuterClass.HelloReply> getSayHelloMethod;
40+
41+
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
42+
public static io.grpc.MethodDescriptor<io.grpc.examples.GreeterOuterClass.HelloRequest,
43+
io.grpc.examples.GreeterOuterClass.HelloReply> getSayHelloMethod() {
44+
io.grpc.MethodDescriptor<io.grpc.examples.GreeterOuterClass.HelloRequest, io.grpc.examples.GreeterOuterClass.HelloReply> getSayHelloMethod;
45+
if ((getSayHelloMethod = GreeterGrpc.getSayHelloMethod) == null) {
46+
synchronized (GreeterGrpc.class) {
47+
if ((getSayHelloMethod = GreeterGrpc.getSayHelloMethod) == null) {
48+
GreeterGrpc.getSayHelloMethod = getSayHelloMethod =
49+
io.grpc.MethodDescriptor.<io.grpc.examples.GreeterOuterClass.HelloRequest, io.grpc.examples.GreeterOuterClass.HelloReply>newBuilder()
50+
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
51+
.setFullMethodName(generateFullMethodName(
52+
"Greeter", "SayHello"))
53+
.setSampledToLocalTracing(true)
54+
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
55+
io.grpc.examples.GreeterOuterClass.HelloRequest.getDefaultInstance()))
56+
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
57+
io.grpc.examples.GreeterOuterClass.HelloReply.getDefaultInstance()))
58+
.setSchemaDescriptor(new GreeterMethodDescriptorSupplier("SayHello"))
59+
.build();
60+
}
61+
}
62+
}
63+
return getSayHelloMethod;
64+
}
4665

4766
/**
4867
* Creates a new async stub that supports all call types for the service
@@ -81,13 +100,13 @@ public static abstract class GreeterImplBase implements io.grpc.BindableService
81100
*/
82101
public void sayHello(io.grpc.examples.GreeterOuterClass.HelloRequest request,
83102
io.grpc.stub.StreamObserver<io.grpc.examples.GreeterOuterClass.HelloReply> responseObserver) {
84-
asyncUnimplementedUnaryCall(METHOD_SAY_HELLO, responseObserver);
103+
asyncUnimplementedUnaryCall(getSayHelloMethod(), responseObserver);
85104
}
86105

87106
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
88107
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
89108
.addMethod(
90-
METHOD_SAY_HELLO,
109+
getSayHelloMethod(),
91110
asyncUnaryCall(
92111
new MethodHandlers<
93112
io.grpc.examples.GreeterOuterClass.HelloRequest,
@@ -126,7 +145,7 @@ protected GreeterStub build(io.grpc.Channel channel,
126145
public void sayHello(io.grpc.examples.GreeterOuterClass.HelloRequest request,
127146
io.grpc.stub.StreamObserver<io.grpc.examples.GreeterOuterClass.HelloReply> responseObserver) {
128147
asyncUnaryCall(
129-
getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request, responseObserver);
148+
getChannel().newCall(getSayHelloMethod(), getCallOptions()), request, responseObserver);
130149
}
131150
}
132151

@@ -158,7 +177,7 @@ protected GreeterBlockingStub build(io.grpc.Channel channel,
158177
*/
159178
public io.grpc.examples.GreeterOuterClass.HelloReply sayHello(io.grpc.examples.GreeterOuterClass.HelloRequest request) {
160179
return blockingUnaryCall(
161-
getChannel(), METHOD_SAY_HELLO, getCallOptions(), request);
180+
getChannel(), getSayHelloMethod(), getCallOptions(), request);
162181
}
163182
}
164183

@@ -191,7 +210,7 @@ protected GreeterFutureStub build(io.grpc.Channel channel,
191210
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.GreeterOuterClass.HelloReply> sayHello(
192211
io.grpc.examples.GreeterOuterClass.HelloRequest request) {
193212
return futureUnaryCall(
194-
getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request);
213+
getChannel().newCall(getSayHelloMethod(), getCallOptions()), request);
195214
}
196215
}
197216

@@ -279,7 +298,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
279298
if (result == null) {
280299
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
281300
.setSchemaDescriptor(new GreeterFileDescriptorSupplier())
282-
.addMethod(METHOD_SAY_HELLO)
301+
.addMethod(getSayHelloMethod())
283302
.build();
284303
}
285304
}

0 commit comments

Comments
 (0)