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}
+