From 415a7a6a2cf026d11acadcad17b5777f32b1a08a Mon Sep 17 00:00:00 2001 From: Tyler Van Gorder Date: Tue, 4 Dec 2018 13:22:03 -0800 Subject: [PATCH] First attempt to add GRPC instrumentation (#1139) * Adding preliminary GRPC instrumentation to Sleuth fixes #305 --- .../main/asciidoc/spring-cloud-sleuth.adoc | 38 ++ spring-cloud-sleuth-core/pom.xml | 18 + .../GrpcManagedChannelBuilderCustomizer.java | 31 + .../SpringAwareManagedChannelBuilder.java | 76 +++ .../grpc/TraceGrpcAutoConfiguration.java | 73 +++ ...racingManagedChannelBuilderCustomizer.java | 42 ++ ...itional-spring-configuration-metadata.json | 6 + .../main/resources/META-INF/spring.factories | 1 + .../grpc/GrpcTracingIntegrationTests.java | 208 +++++++ .../instrument/grpc/stubs/HelloReply.java | 588 ++++++++++++++++++ .../grpc/stubs/HelloReplyOrBuilder.java | 33 + .../instrument/grpc/stubs/HelloRequest.java | 588 ++++++++++++++++++ .../grpc/stubs/HelloRequestOrBuilder.java | 33 + .../grpc/stubs/HelloServiceGrpc.java | 331 ++++++++++ .../grpc/stubs/HelloServiceOuterClass.java | 75 +++ spring-cloud-sleuth-dependencies/pom.xml | 7 + 16 files changed, 2148 insertions(+) create mode 100644 spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/GrpcManagedChannelBuilderCustomizer.java create mode 100644 spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/SpringAwareManagedChannelBuilder.java create mode 100644 spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/TraceGrpcAutoConfiguration.java create mode 100644 spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/TracingManagedChannelBuilderCustomizer.java create mode 100644 spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/GrpcTracingIntegrationTests.java create mode 100644 spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReply.java create mode 100644 spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReplyOrBuilder.java create mode 100644 spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequest.java create mode 100644 spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequestOrBuilder.java create mode 100644 spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloServiceGrpc.java create mode 100644 spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloServiceOuterClass.java diff --git a/docs/src/main/asciidoc/spring-cloud-sleuth.adoc b/docs/src/main/asciidoc/spring-cloud-sleuth.adoc index 5a1e3443e..17904d256 100644 --- a/docs/src/main/asciidoc/spring-cloud-sleuth.adoc +++ b/docs/src/main/asciidoc/spring-cloud-sleuth.adoc @@ -1210,6 +1210,44 @@ You can disable it by setting `spring.sleuth.feign.processor.enabled` to `false` If you set it to `false`, Spring Cloud Sleuth does not instrument any of your custom Feign components. However, all the default instrumentation is still there. +=== gRPC + +Spring Cloud Sleuth provides instrumentation for https://grpc.io/[gRPC] through `TraceGrpcAutoConfiguration`. You can disable it entirely by setting `spring.sleuth.grpc.enabled` to `false`. + +==== Dependencies +IMPORTANT: The gRPC integration relies on two external libraries to instrument clients and servers and both of those libraries must be on the class path to enable the instrumentation. + +Maven: +``` + + io.github.lognet + grpc-spring-boot-starter + + + io.zipkin.brave + brave-instrumentation-grpc + +``` +Gradle: +``` + compile("io.github.lognet:grpc-spring-boot-starter") + compile("io.zipkin.brave:brave-instrumentation-grpc") +``` + +==== Server Instrumentation + +Spring Cloud Sleuth leverages grpc-spring-boot-starter to register Brave's gRPC server interceptor with all services annotated with `@GRpcService`. + +==== Client Instrumentation + +gRPC clients leverage a `ManagedChannelBuilder` to construct a `ManagedChannel` used to communicate to the gRPC server. The native `ManagedChannelBuilder` provides static methods as entry points for construction of `ManagedChannel` instances, however, this mechanism is outside the influence of the Spring application context. + +IMPORTANT: Spring Cloud Sleuth provides a `SpringAwareManagedChannelBuilder` that can be customized through the Spring application context and injected by gRPC clients. *This builder must be used when creating `ManagedChannel` instances.* + + +Sleuth creates a `TracingManagedChannelBuilderCustomizer` which inject Brave's client interceptor into the `SpringAwareManagedChannelBuilder`. + + === Asynchronous Communication ==== `@Async` Annotated methods diff --git a/spring-cloud-sleuth-core/pom.xml b/spring-cloud-sleuth-core/pom.xml index 194cc176a..1534a4b2f 100644 --- a/spring-cloud-sleuth-core/pom.xml +++ b/spring-cloud-sleuth-core/pom.xml @@ -233,6 +233,17 @@ spring-jms true + + + io.github.lognet + grpc-spring-boot-starter + true + + + io.zipkin.brave + brave-instrumentation-grpc + true + org.springframework.boot spring-boot-autoconfigure-processor @@ -311,6 +322,13 @@ activemq-ra test + + + com.google.guava + guava + 20.0 + test + diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/GrpcManagedChannelBuilderCustomizer.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/GrpcManagedChannelBuilderCustomizer.java new file mode 100644 index 000000000..37c428f28 --- /dev/null +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/GrpcManagedChannelBuilderCustomizer.java @@ -0,0 +1,31 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc; + +import io.grpc.ManagedChannelBuilder; + +/** + * Callback interface that can be implemented by beans wishing to further customize the + * {@link io.grpc.ManagedChannelBuilder} via the {@link SpringAwareManagedChannelBuilder}. + * + * @author tyler.vangorder + */ +public interface GrpcManagedChannelBuilderCustomizer { + + void customize(ManagedChannelBuilder managedChannelBuilder); + +} diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/SpringAwareManagedChannelBuilder.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/SpringAwareManagedChannelBuilder.java new file mode 100644 index 000000000..cc186465e --- /dev/null +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/SpringAwareManagedChannelBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2013-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc; + +import java.util.List; +import java.util.Optional; + +import io.grpc.ManagedChannelBuilder; +import io.grpc.inprocess.InProcessChannelBuilder; + +/** + * This is a Spring-aware managed channel builder that wraps the static entry points of + * gRPC's ManagedChannelBuilder to allow the configuration of the builder to be influenced + * by the Spring Context. All GrpcManagedChannelBuilderCustomizer instances included in + * the application context will have the opportunity to customize the builder. + * + * NOTE: There is nothing "Sleuth-specific" about this, however, there is currently not a + * good spring abstraction for client-side gRPC. Ideally, this could be moved up into + * grpc-spring-boot-starter or a new project could be created + * "spring-grpc"/"spring-cloud-grpc"? + * + * @author tyler.vangorder + */ +public class SpringAwareManagedChannelBuilder { + + private List customizers; + + public SpringAwareManagedChannelBuilder( + Optional> customizers) { + this.customizers = customizers.orElse(null); + } + + public ManagedChannelBuilder forAddress(String name, int port) { + + ManagedChannelBuilder builder = ManagedChannelBuilder.forAddress(name, port); + + if (this.customizers != null) { + this.customizers.stream() + .forEach(customizer -> customizer.customize(builder)); + } + return builder; + } + + public ManagedChannelBuilder forTarget(String target) { + ManagedChannelBuilder builder = ManagedChannelBuilder.forTarget(target); + if (this.customizers != null) { + this.customizers.stream() + .forEach(customizer -> customizer.customize(builder)); + } + return builder; + } + + public ManagedChannelBuilder inProcessChannelBuilder(String serverName) { + ManagedChannelBuilder builder = InProcessChannelBuilder.forName(serverName); + if (this.customizers != null) { + this.customizers.stream() + .forEach(customizer -> customizer.customize(builder)); + } + return builder; + } + +} diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/TraceGrpcAutoConfiguration.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/TraceGrpcAutoConfiguration.java new file mode 100644 index 000000000..4d686fd83 --- /dev/null +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/TraceGrpcAutoConfiguration.java @@ -0,0 +1,73 @@ +/* + * Copyright 2013-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc; + +import java.util.List; +import java.util.Optional; + +import brave.Tracing; +import brave.grpc.GrpcTracing; +import io.grpc.ServerInterceptor; +import org.lognet.springboot.grpc.GRpcGlobalInterceptor; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; + +/** + * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration + * Auto-configuration} enables span information propagation when using GRPC. + * + * This configuration is only enabled when both grpc-spring-boot-starter and + * brave-instrumentation-grpc are on the classpath. + * + * @author tyler.vangorder + */ +@ConditionalOnClass({ GrpcTracing.class, GRpcGlobalInterceptor.class }) +@ConditionalOnProperty(value = "spring.sleuth.grpc.enabled", matchIfMissing = true) +@ConditionalOnBean(Tracing.class) +public class TraceGrpcAutoConfiguration { + + @Bean + public GrpcTracing grpcTracing(Tracing tracing) { + return GrpcTracing.create(tracing); + } + + // Register a global interceptor for both the server + @Bean + @GRpcGlobalInterceptor + ServerInterceptor grpcServerBraveInterceptor(GrpcTracing grpcTracing) { + return grpcTracing.newServerInterceptor(); + } + + // This is wrapper around gRPC's managed channel builder that is spring-aware + @Bean + @ConditionalOnMissingBean(SpringAwareManagedChannelBuilder.class) + public SpringAwareManagedChannelBuilder managedChannelBuilder( + Optional> customizers) { + return new SpringAwareManagedChannelBuilder(customizers); + } + + @Bean + GrpcManagedChannelBuilderCustomizer tracingManagedChannelBuilderCustomizer( + GrpcTracing grpcTracing) { + return new TracingManagedChannelBuilderCustomizer(grpcTracing); + } + +} diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/TracingManagedChannelBuilderCustomizer.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/TracingManagedChannelBuilderCustomizer.java new file mode 100644 index 000000000..cb94ac11e --- /dev/null +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/grpc/TracingManagedChannelBuilderCustomizer.java @@ -0,0 +1,42 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc; + +import brave.grpc.GrpcTracing; +import io.grpc.ManagedChannelBuilder; + +/** + * @author tyler.vangorder + */ +public class TracingManagedChannelBuilderCustomizer + implements GrpcManagedChannelBuilderCustomizer { + + GrpcTracing grpcTracing; + + public TracingManagedChannelBuilderCustomizer(GrpcTracing grpcTracing) { + this.grpcTracing = grpcTracing; + } + + /** + * Add brave's client interceptor to the builder. + */ + @Override + public void customize(ManagedChannelBuilder managedChannelBuilder) { + managedChannelBuilder.intercept(this.grpcTracing.newClientInterceptor()); + } + +} diff --git a/spring-cloud-sleuth-core/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-sleuth-core/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 100fdd224..63b54b3fa 100644 --- a/spring-cloud-sleuth-core/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-cloud-sleuth-core/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -46,5 +46,11 @@ "type": "java.lang.Boolean", "description": "Enable span information propagation when using Zuul.", "defaultValue": true + }, + { + "name": "spring.sleuth.grpc.enabled", + "type": "java.lang.Boolean", + "description": "Enable span information propagation when using GRPC.", + "defaultValue": true } ]} \ No newline at end of file diff --git a/spring-cloud-sleuth-core/src/main/resources/META-INF/spring.factories b/spring-cloud-sleuth-core/src/main/resources/META-INF/spring.factories index 09a0a60af..2043bd2c5 100644 --- a/spring-cloud-sleuth-core/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-sleuth-core/src/main/resources/META-INF/spring.factories @@ -18,6 +18,7 @@ org.springframework.cloud.sleuth.instrument.rxjava.RxJavaAutoConfiguration,\ org.springframework.cloud.sleuth.instrument.reactor.TraceReactorAutoConfiguration,\ org.springframework.cloud.sleuth.instrument.web.TraceWebFluxAutoConfiguration,\ org.springframework.cloud.sleuth.instrument.zuul.TraceZuulAutoConfiguration,\ +org.springframework.cloud.sleuth.instrument.grpc.TraceGrpcAutoConfiguration,\ org.springframework.cloud.sleuth.instrument.messaging.TraceMessagingAutoConfiguration,\ org.springframework.cloud.sleuth.instrument.messaging.TraceSpringIntegrationAutoConfiguration,\ org.springframework.cloud.sleuth.instrument.messaging.websocket.TraceWebSocketAutoConfiguration,\ diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/GrpcTracingIntegrationTests.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/GrpcTracingIntegrationTests.java new file mode 100644 index 000000000..46f3a006d --- /dev/null +++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/GrpcTracingIntegrationTests.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +import brave.sampler.Sampler; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannel; +import io.grpc.ServerBuilder; +import io.grpc.stub.StreamObserver; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.lognet.springboot.grpc.GRpcServerBuilderConfigurer; +import org.lognet.springboot.grpc.GRpcService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import zipkin2.Span; +import zipkin2.reporter.Reporter; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.cloud.sleuth.instrument.grpc.stubs.HelloReply; +import org.springframework.cloud.sleuth.instrument.grpc.stubs.HelloRequest; +import org.springframework.cloud.sleuth.instrument.grpc.stubs.HelloServiceGrpc; +import org.springframework.cloud.sleuth.instrument.grpc.stubs.HelloServiceGrpc.HelloServiceBlockingStub; +import org.springframework.cloud.sleuth.instrument.grpc.stubs.HelloServiceGrpc.HelloServiceImplBase; +import org.springframework.cloud.sleuth.util.ArrayListSpanReporter; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.util.ReflectionTestUtils; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * This integration testing class starts an in-process gRPC server and calls that server + * via the client. + * + * This class uses stubs and skeletons that were generated originally by the gRPC maven + * plugin and copied into a "stubs" sub-package. + * + * @author tyler.vangorder + */ +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest(classes = GrpcTracingIntegrationTests.TestConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.NONE, properties = { + "grpc.enabled=false", "grpc.inProcessServerName=testServer" }) +@DirtiesContext +public class GrpcTracingIntegrationTests { + + @Autowired + SpringAwareManagedChannelBuilder clientManagedChannelBuilder; + + @Autowired + ArrayListSpanReporter reporter; + + @Before + public void beforeTest() { + this.reporter.clear(); + } + + @After + public void afterTest() { + this.reporter.clear(); + } + + @Test + public void integrationTest() throws Exception { + ManagedChannel inProcessManagedChannel = this.clientManagedChannelBuilder + .inProcessChannelBuilder("testServer").directExecutor().build(); + + HelloServiceGrpcClient client = new HelloServiceGrpcClient( + inProcessManagedChannel); + + assertThat(client.sayHello("Testy McTest Face")) + .isEqualTo("Hello Testy McTest Face"); + List spans = this.reporter.getSpans(); + assertThat(spans).hasSize(2); + assertThat(spans.get(0).kind()).isEqualTo(Span.Kind.SERVER); + assertThat(spans.get(1).kind()).isEqualTo(Span.Kind.CLIENT); + + // ManagedChannel does not implement Closeable... + inProcessManagedChannel.shutdownNow(); + } + + @Test + public void channelBuilderFromAddress() { + // Simple test to make sure the interceptor is added to the builder. + this.clientManagedChannelBuilder.forAddress("test", 1234); + @SuppressWarnings("unchecked") + List clientInterceptors = (List) ReflectionTestUtils + .getField(this.clientManagedChannelBuilder, "customizers"); + assertThat(clientInterceptors).hasSize(1); + } + + @Test + public void channelBuilderFromTarget() { + // Simple test to make sure the interceptor is added to the builder. + this.clientManagedChannelBuilder.forTarget("test"); + @SuppressWarnings("unchecked") + List clientInterceptors = (List) ReflectionTestUtils + .getField(this.clientManagedChannelBuilder, "customizers"); + assertThat(clientInterceptors).hasSize(1); + } + + @Configuration + @EnableAutoConfiguration + @Import(HelloGrpcService.class) + public static class TestConfiguration { + + @Bean + Sampler alwaysSampler() { + return Sampler.ALWAYS_SAMPLE; + } + + @Bean + Reporter reporter() { + return new ArrayListSpanReporter(); + + } + + @Bean + GRpcServerBuilderConfigurer serverBuilderConfigurer() { + return new TestGrpcConfig(); + } + + } + + public static class TestGrpcConfig extends GRpcServerBuilderConfigurer { + + @Override + public void configure(ServerBuilder serverBuilder) { + serverBuilder.directExecutor(); + } + + } + + @GRpcService + public static class HelloGrpcService extends HelloServiceImplBase { + + private Logger logger = LoggerFactory.getLogger(HelloGrpcService.class); + + @Override + public void sayHello(HelloRequest request, + StreamObserver responseObserver) { + String message = "Hello " + request.getName(); + this.logger.debug("In the grpc server stub."); + HelloReply reply = HelloReply.newBuilder().setMessage(message).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } + + } + + public static interface HelloServiceClient { + + String sayHello(String name) throws Exception; + + } + + public static class HelloServiceGrpcClient implements HelloServiceClient { + + private ManagedChannel managedChannel; + + public HelloServiceGrpcClient(ManagedChannel managedChannel) { + this.managedChannel = managedChannel; + } + + /* + * (non-Javadoc) + * + * @see sample.HelloServiceClient#sayHello(java.lang.String) + */ + @Override + public String sayHello(String name) throws Exception { + + HelloServiceBlockingStub stub = HelloServiceGrpc + .newBlockingStub(this.managedChannel) + .withDeadlineAfter(3, TimeUnit.SECONDS); + HelloReply reply = stub + .sayHello(HelloRequest.newBuilder().setName(name).build()); + return reply.getMessage(); + + } + + } + +} diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReply.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReply.java new file mode 100644 index 000000000..6e3968e58 --- /dev/null +++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReply.java @@ -0,0 +1,588 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc.stubs; + +/** + *
+ * The response message containing the greetings
+ * 
+ * + * Protobuf type {@code HelloReply} + */ +public final class HelloReply extends com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:HelloReply) + HelloReplyOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use HelloReply.newBuilder() to construct. + private HelloReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HelloReply() { + this.message_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private HelloReply(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet + .newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, + tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + this.message_ = s; + break; + } + } + } + } + catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } + catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } + finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloReply_descriptor; + } + + @Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloReply_fieldAccessorTable + .ensureFieldAccessorsInitialized(HelloReply.class, + HelloReply.Builder.class); + } + + public static final int MESSAGE_FIELD_NUMBER = 1; + + private volatile java.lang.Object message_; + + /** + * string message = 1; + */ + @Override + public java.lang.String getMessage() { + java.lang.Object ref = this.message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } + else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + this.message_ = s; + return s; + } + } + + /** + * string message = 1; + */ + @Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = this.message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString + .copyFromUtf8((java.lang.String) ref); + this.message_ = b; + return b; + } + else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = this.memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + this.memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, this.message_); + } + this.unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = this.memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, + this.message_); + } + size += this.unknownFields.getSerializedSize(); + this.memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof HelloReply)) { + return super.equals(obj); + } + HelloReply other = (HelloReply) obj; + + boolean result = true; + result = result && getMessage().equals(other.getMessage()); + result = result && this.unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (this.memoizedHashCode != 0) { + return this.memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + this.unknownFields.hashCode(); + this.memoizedHashCode = hash; + return hash; + } + + public static HelloReply parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static HelloReply parseFrom(java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static HelloReply parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static HelloReply parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static HelloReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static HelloReply parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static HelloReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static HelloReply parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, + extensionRegistry); + } + + public static HelloReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static HelloReply parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + + public static HelloReply parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static HelloReply parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, + extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(HelloReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + *
+	 * The response message containing the greetings
+	 * 
+ * + * Protobuf type {@code HelloReply} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:HelloReply) + HelloReplyOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloReply_descriptor; + } + + @Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloReply_fieldAccessorTable + .ensureFieldAccessorsInitialized(HelloReply.class, + HelloReply.Builder.class); + } + + // Construct using HelloReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + this.message_ = ""; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloReply_descriptor; + } + + @Override + public HelloReply getDefaultInstanceForType() { + return HelloReply.getDefaultInstance(); + } + + @Override + public HelloReply build() { + HelloReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public HelloReply buildPartial() { + HelloReply result = new HelloReply(this); + result.message_ = this.message_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof HelloReply) { + return mergeFrom((HelloReply) other); + } + else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(HelloReply other) { + if (other == HelloReply.getDefaultInstance()) { + return this; + } + if (!other.getMessage().isEmpty()) { + this.message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + HelloReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } + catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (HelloReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } + finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object message_ = ""; + + /** + * string message = 1; + */ + @Override + public java.lang.String getMessage() { + java.lang.Object ref = this.message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + this.message_ = s; + return s; + } + else { + return (java.lang.String) ref; + } + } + + /** + * string message = 1; + */ + @Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = this.message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString + .copyFromUtf8((java.lang.String) ref); + this.message_ = b; + return b; + } + else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string message = 1; + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + this.message_ = value; + onChanged(); + return this; + } + + /** + * string message = 1; + */ + public Builder clearMessage() { + + this.message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + + /** + * string message = 1; + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + this.message_ = value; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:HelloReply) + + } + + // @@protoc_insertion_point(class_scope:HelloReply) + private static final HelloReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HelloReply(); + } + + public static HelloReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @Override + public HelloReply parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HelloReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public HelloReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReplyOrBuilder.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReplyOrBuilder.java new file mode 100644 index 000000000..71f62c257 --- /dev/null +++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReplyOrBuilder.java @@ -0,0 +1,33 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc.stubs; + +public interface HelloReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:sample.grpc.HelloReply) + com.google.protobuf.MessageOrBuilder { + + /** + * string message = 1; + */ + java.lang.String getMessage(); + + /** + * string message = 1; + */ + com.google.protobuf.ByteString getMessageBytes(); + +} diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequest.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequest.java new file mode 100644 index 000000000..4384dd4f0 --- /dev/null +++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequest.java @@ -0,0 +1,588 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc.stubs; + +/** + *
+ * The request message containing the user's name.
+ * 
+ * + * Protobuf type {@code HelloRequest} + */ +public final class HelloRequest extends com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:HelloRequest) + HelloRequestOrBuilder { + + private static final long serialVersionUID = 0L; + + // Use HelloRequest.newBuilder() to construct. + private HelloRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HelloRequest() { + this.name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private HelloRequest(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet + .newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, + tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + this.name_ = s; + break; + } + } + } + } + catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } + catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } + finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloRequest_descriptor; + } + + @Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized(HelloRequest.class, + HelloRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + private volatile java.lang.Object name_; + + /** + * string name = 1; + */ + @Override + public java.lang.String getName() { + java.lang.Object ref = this.name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } + else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + this.name_ = s; + return s; + } + } + + /** + * string name = 1; + */ + @Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = this.name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString + .copyFromUtf8((java.lang.String) ref); + this.name_ = b; + return b; + } + else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = this.memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + this.memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, this.name_); + } + this.unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = this.memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, + this.name_); + } + size += this.unknownFields.getSerializedSize(); + this.memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof HelloRequest)) { + return super.equals(obj); + } + HelloRequest other = (HelloRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && this.unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (this.memoizedHashCode != 0) { + return this.memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + this.unknownFields.hashCode(); + this.memoizedHashCode = hash; + return hash; + } + + public static HelloRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static HelloRequest parseFrom(java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static HelloRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static HelloRequest parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static HelloRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static HelloRequest parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static HelloRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static HelloRequest parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, + extensionRegistry); + } + + public static HelloRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static HelloRequest parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + + public static HelloRequest parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static HelloRequest parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, + extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(HelloRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + *
+	 * The request message containing the user's name.
+	 * 
+ * + * Protobuf type {@code HelloRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:HelloRequest) + HelloRequestOrBuilder { + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloRequest_descriptor; + } + + @Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized(HelloRequest.class, + HelloRequest.Builder.class); + } + + // Construct using HelloRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + } + } + + @Override + public Builder clear() { + super.clear(); + this.name_ = ""; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return HelloServiceOuterClass.internal_static_sample_grpc_HelloRequest_descriptor; + } + + @Override + public HelloRequest getDefaultInstanceForType() { + return HelloRequest.getDefaultInstance(); + } + + @Override + public HelloRequest build() { + HelloRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public HelloRequest buildPartial() { + HelloRequest result = new HelloRequest(this); + result.name_ = this.name_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof HelloRequest) { + return mergeFrom((HelloRequest) other); + } + else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(HelloRequest other) { + if (other == HelloRequest.getDefaultInstance()) { + return this; + } + if (!other.getName().isEmpty()) { + this.name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + HelloRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } + catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (HelloRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } + finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * string name = 1; + */ + @Override + public java.lang.String getName() { + java.lang.Object ref = this.name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + this.name_ = s; + return s; + } + else { + return (java.lang.String) ref; + } + } + + /** + * string name = 1; + */ + @Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = this.name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString + .copyFromUtf8((java.lang.String) ref); + this.name_ = b; + return b; + } + else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + this.name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1; + */ + public Builder clearName() { + + this.name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + this.name_ = value; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:HelloRequest) + + } + + // @@protoc_insertion_point(class_scope:HelloRequest) + private static final HelloRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new HelloRequest(); + } + + public static HelloRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @Override + public HelloRequest parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HelloRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public HelloRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequestOrBuilder.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequestOrBuilder.java new file mode 100644 index 000000000..272583fdc --- /dev/null +++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequestOrBuilder.java @@ -0,0 +1,33 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc.stubs; + +public interface HelloRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:sample.grpc.HelloRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + */ + java.lang.String getName(); + + /** + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + +} diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloServiceGrpc.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloServiceGrpc.java new file mode 100644 index 000000000..cb4d1d534 --- /dev/null +++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloServiceGrpc.java @@ -0,0 +1,331 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc.stubs; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * The Hello service definition.
+ * 
+ */ +@javax.annotation.Generated(value = "by gRPC proto compiler (version 1.15.1)", comments = "Source: HelloService.proto") +public final class HelloServiceGrpc { + + private HelloServiceGrpc() { + } + + public static final String SERVICE_NAME = "HelloService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getSayHelloMethod; + + @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + + "SayHello", requestType = HelloRequest.class, responseType = HelloReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSayHelloMethod() { + io.grpc.MethodDescriptor getSayHelloMethod; + if ((getSayHelloMethod = HelloServiceGrpc.getSayHelloMethod) == null) { + synchronized (HelloServiceGrpc.class) { + if ((getSayHelloMethod = HelloServiceGrpc.getSayHelloMethod) == null) { + HelloServiceGrpc.getSayHelloMethod = getSayHelloMethod = io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("HelloService", "SayHello")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils + .marshaller(HelloRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils + .marshaller(HelloReply.getDefaultInstance())) + .setSchemaDescriptor( + new HelloServiceMethodDescriptorSupplier("SayHello")) + .build(); + } + } + } + return getSayHelloMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static HelloServiceStub newStub(io.grpc.Channel channel) { + return new HelloServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming + * output calls on the service + */ + public static HelloServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new HelloServiceBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on + * the service + */ + public static HelloServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new HelloServiceFutureStub(channel); + } + + /** + *
+	 * The Hello service definition.
+	 * 
+ */ + public static abstract class HelloServiceImplBase implements io.grpc.BindableService { + + /** + *
+		 * Sends a greeting
+		 * 
+ */ + public void sayHello(HelloRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSayHelloMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod(getSayHelloMethod(), + asyncUnaryCall(new MethodHandlers( + this, METHODID_SAY_HELLO))) + .build(); + } + + } + + /** + *
+	 * The Hello service definition.
+	 * 
+ */ + public static final class HelloServiceStub + extends io.grpc.stub.AbstractStub { + + private HelloServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private HelloServiceStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HelloServiceStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new HelloServiceStub(channel, callOptions); + } + + /** + *
+		 * Sends a greeting
+		 * 
+ */ + public void sayHello(HelloRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall(getChannel().newCall(getSayHelloMethod(), getCallOptions()), + request, responseObserver); + } + + } + + /** + *
+	 * The Hello service definition.
+	 * 
+ */ + public static final class HelloServiceBlockingStub + extends io.grpc.stub.AbstractStub { + + private HelloServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private HelloServiceBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HelloServiceBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new HelloServiceBlockingStub(channel, callOptions); + } + + /** + *
+		 * Sends a greeting
+		 * 
+ */ + public HelloReply sayHello(HelloRequest request) { + return blockingUnaryCall(getChannel(), getSayHelloMethod(), getCallOptions(), + request); + } + + } + + /** + *
+	 * The Hello service definition.
+	 * 
+ */ + public static final class HelloServiceFutureStub + extends io.grpc.stub.AbstractStub { + + private HelloServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private HelloServiceFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HelloServiceFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new HelloServiceFutureStub(channel, callOptions); + } + + /** + *
+		 * Sends a greeting
+		 * 
+ */ + public com.google.common.util.concurrent.ListenableFuture sayHello( + HelloRequest request) { + return futureUnaryCall( + getChannel().newCall(getSayHelloMethod(), getCallOptions()), request); + } + + } + + private static final int METHODID_SAY_HELLO = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + + private final HelloServiceImplBase serviceImpl; + + private final int methodId; + + MethodHandlers(HelloServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, + io.grpc.stub.StreamObserver responseObserver) { + switch (this.methodId) { + case METHODID_SAY_HELLO: + this.serviceImpl.sayHello((HelloRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (this.methodId) { + default: + throw new AssertionError(); + } + } + + } + + private static abstract class HelloServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + + HelloServiceBaseDescriptorSupplier() { + } + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return HelloServiceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("HelloService"); + } + + } + + private static final class HelloServiceFileDescriptorSupplier + extends HelloServiceBaseDescriptorSupplier { + + HelloServiceFileDescriptorSupplier() { + } + + } + + private static final class HelloServiceMethodDescriptorSupplier + extends HelloServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + + private final String methodName; + + HelloServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(this.methodName); + } + + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (HelloServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor + .newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new HelloServiceFileDescriptorSupplier()) + .addMethod(getSayHelloMethod()).build(); + } + } + } + return result; + } + +} diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloServiceOuterClass.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloServiceOuterClass.java new file mode 100644 index 000000000..3e6e6b798 --- /dev/null +++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloServiceOuterClass.java @@ -0,0 +1,75 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.sleuth.instrument.grpc.stubs; + +public final class HelloServiceOuterClass { + + private HelloServiceOuterClass() { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor internal_static_sample_grpc_HelloRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_sample_grpc_HelloRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor internal_static_sample_grpc_HelloReply_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_sample_grpc_HelloReply_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + static { + java.lang.String[] descriptorData = { + "\n\022HelloService.proto\022\013sample.grpc\"\034\n\014Hel" + + "loRequest\022\014\n\004name\030\001 \001(\t\"\035\n\nHelloReply\022\017\n" + + "\007message\030\001 \001(\t2P\n\014HelloService\022@\n\010SayHel" + + "lo\022\031.sample.grpc.HelloRequest\032\027.sample.g" + + "rpc.HelloReply\"\000B\002P\001b\006proto3" }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + @Override + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}, + assigner); + internal_static_sample_grpc_HelloRequest_descriptor = getDescriptor() + .getMessageTypes().get(0); + internal_static_sample_grpc_HelloRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_sample_grpc_HelloRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_sample_grpc_HelloReply_descriptor = getDescriptor() + .getMessageTypes().get(1); + internal_static_sample_grpc_HelloReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_sample_grpc_HelloReply_descriptor, + new java.lang.String[] { "Message", }); + } + + // @@protoc_insertion_point(outer_class_scope) + +} diff --git a/spring-cloud-sleuth-dependencies/pom.xml b/spring-cloud-sleuth-dependencies/pom.xml index 768d0788c..8c5d0553f 100644 --- a/spring-cloud-sleuth-dependencies/pom.xml +++ b/spring-cloud-sleuth-dependencies/pom.xml @@ -31,6 +31,7 @@ Spring Cloud Sleuth Dependencies 0.33.7 + 3.0.0 @@ -75,6 +76,12 @@ brave-opentracing ${brave.opentracing.version} + + + io.github.lognet + grpc-spring-boot-starter + ${grpc.spring.boot.version} +