From d3b787fb77c80bb2d96dee93ff883d8c6b2465de Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Tue, 14 May 2024 09:51:48 +0800 Subject: [PATCH] fixes grpc example and bumps all deps including docker images Signed-off-by: Adrian Cole --- README.md | 6 +- armeria-kafka/pom.xml | 4 +- armeria/pom.xml | 45 +--- build-bin/docker/docker_args | 6 +- build-bin/docker_args | 20 +- docker/Dockerfile | 4 +- jersey2-cassandra3/pom.xml | 8 +- netty4-grpc/README.md | 4 +- netty4-grpc/pom.xml | 13 +- .../src/main/java/brave/example/Backend.java | 2 +- .../brave/example/TracingConfiguration.java | 2 +- .../brave/example/generated/BackendGrpc.java | 79 +++--- .../brave/example/generated/BackendProto.java | 254 ++++++++---------- .../src/main/resources/log4j.properties | 5 + netty4-grpc/src/main/resources/logback.xml | 14 - parent-pom.xml | 6 +- webflux5-sleuth/pom.xml | 2 +- webflux6-micrometer/pom.xml | 4 +- webmvc4-jetty/pom.xml | 2 +- 19 files changed, 201 insertions(+), 279 deletions(-) create mode 100644 netty4-grpc/src/main/resources/log4j.properties delete mode 100644 netty4-grpc/src/main/resources/logback.xml diff --git a/README.md b/README.md index 63de77d..cefd58d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This is an example app where two Java services collaborate on a request. Notably, these services send data to [Zipkin](https://zipkin.io/), a -distributed tracing system. Zipkin allows you to see the how long the operation +distributed tracing system. Zipkin allows you to see how long the operation took, as well how much time was spent in each service. Here's an example of what it looks like: @@ -15,7 +15,7 @@ to send tracing data to a third service [Zipkin](https://zipkin.io/). [Brave](ht performs this function. # Running the example -To setup the demo, you need to start Frontend, Backend and Zipkin. You can do +To set up the demo, you need to start Frontend, Backend and Zipkin. You can do this using Java commands or Docker. Once the services start, open http://localhost:8081/ @@ -54,7 +54,7 @@ Here are the example projects you can try: * Trace Configuration: [Brave API](https://github.com/openzipkin/brave/tree/master/brave#setup) [XML](jersey2-cassandra3/src/main/webapp/WEB-INF/tracing.xml) * [netty4-grpc](netty4-grpc) `BRAVE_EXAMPLE=netty4-grpc docker-compose up` - * Runtime: Netty 4.1, Google gRPC 1.34 , SLF4J 1.7, JRE 21 + * Runtime: Netty 4.1, Google gRPC 1.63, SLF4J 1.7, JRE 21 * Trace Instrumentation: [Netty Codec HTTP](https://github.com/openzipkin/brave/tree/master/instrumentation/netty-codec-http), [Google gRPC](https://github.com/openzipkin/brave/tree/master/instrumentation/grpc), [SLF4J](https://github.com/openzipkin/brave/tree/master/context/slf4j) * Trace Configuration: [Brave API](https://github.com/openzipkin/brave/tree/master/brave#setup) [Java](netty4-grpc/src/main/java/brave/example/TracingConfiguration.java) diff --git a/armeria-kafka/pom.xml b/armeria-kafka/pom.xml index 3f6c726..f953cc8 100644 --- a/armeria-kafka/pom.xml +++ b/armeria-kafka/pom.xml @@ -20,8 +20,8 @@ 21 8 - 1.27.2 - 3.6.1 + 1.28.4 + 3.7.0 diff --git a/armeria/pom.xml b/armeria/pom.xml index ef034dc..c4288b6 100644 --- a/armeria/pom.xml +++ b/armeria/pom.xml @@ -20,56 +20,13 @@ 21 8 - 1.27.2 + 1.28.4 com.linecorp.armeria armeria - - - - io.netty - netty-tcnative-boringssl-static - - - - - - io.netty - netty-tcnative-boringssl-static - 2.0.63.Final - linux-x86_64 - runtime - - - io.netty - netty-tcnative-boringssl-static - 2.0.63.Final - linux-aarch_64 - runtime - - - io.netty - netty-tcnative-boringssl-static - 2.0.63.Final - osx-x86_64 - runtime - - - io.netty - netty-tcnative-boringssl-static - 2.0.63.Final - osx-aarch_64 - runtime - - - io.netty - netty-tcnative-boringssl-static - 2.0.63.Final - windows-x86_64 - runtime diff --git a/build-bin/docker/docker_args b/build-bin/docker/docker_args index cec6bea..f59c577 100755 --- a/build-bin/docker/docker_args +++ b/build-bin/docker/docker_args @@ -37,7 +37,7 @@ if [ -n "${DOCKER_TARGET}" ]; then fi # When non-empty, becomes the layer that builds the maven projects. -# e.g. ghcr.io/openzipkin/java:11.0.22_p7 +# e.g. ghcr.io/openzipkin/java:11.0.23_p9 # # This must include maven and a full JDK. if [ -n "${DOCKER_BUILD_IMAGE}" ]; then @@ -45,7 +45,7 @@ if [ -n "${DOCKER_BUILD_IMAGE}" ]; then fi # When non-empty, becomes the base layer including tag appropriate for the image being built. -# e.g. ghcr.io/openzipkin/java:21.0.2_p13-jre +# e.g. ghcr.io/openzipkin/java:21.0.3_p9-jre # # This is not required to be a base (FROM scratch) image like ghcr.io/openzipkin/alpine:3.12.3 # See https://docs.docker.com/glossary/#parent-image @@ -59,7 +59,7 @@ if [ -n "${ALPINE_VERSION}" ]; then docker_args="${docker_args} --build-arg alpine_version=${ALPINE_VERSION}" fi -# When non-empty, becomes the build-arg java_version. e.g. "21.0.2_p13" +# When non-empty, becomes the build-arg java_version. e.g. "21.0.3_p9" # Used to align base layers from https://github.com/orgs/openzipkin/packages/container/package/java if [ -n "${JAVA_VERSION}" ]; then docker_args="${docker_args} --build-arg java_version=${JAVA_VERSION}" diff --git a/build-bin/docker_args b/build-bin/docker_args index 70cfdf6..5ee80c3 100755 --- a/build-bin/docker_args +++ b/build-bin/docker_args @@ -8,38 +8,38 @@ else exit 1 fi -JAVA_VERSION=${JAVA_VERSION:-21.0.2_p13} +JAVA_VERSION=${JAVA_VERSION:-21.0.3_p9} # DOCKER_ARCHS to eventually push to the registry DOCKER_ARCHS="amd64 arm64" case "${JRE_VERSION}" in 6 ) - DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:11.0.22_p7 + DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:11.0.23_p9 DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:1.6.0-119 # single arch image DOCKER_ARCHS=amd64 ;; 7 ) - DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:11.0.22_p7 + DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:11.0.23_p9 DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:1.7.0_285 # single arch image DOCKER_ARCHS=amd64 ;; 8 ) - DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:11.0.22_p7 + DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:11.0.23_p9 DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:8.392.08-jre ;; 11 ) - DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:11.0.22_p7 - DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:11.0.22_p7-jre + DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:11.0.23_p9 + DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:11.0.23_p9-jre ;; 17 ) - DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:21.0.2_p13 - DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:17.0.10_p7-jre + DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:21.0.3_p9 + DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:17.0.11_p9-jre ;; 21 ) - DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:21.0.2_p13 - DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:21.0.2_p13-jre + DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:21.0.3_p9 + DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:21.0.3_p9-jre ;; * ) echo "Invalid JRE_VERSION: ${JRE_VERSION}" diff --git a/docker/Dockerfile b/docker/Dockerfile index 9fb2705..6281d41 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,9 +2,9 @@ # non-root users and such as they are not intended to run in production anyway. # The image binaries this example builds are installed over -ARG docker_parent_image=ghcr.io/openzipkin/java:21.0.2_p13 +ARG docker_parent_image=ghcr.io/openzipkin/java:21.0.3_p9 ## Use JDK 11 to build projects, as that can still compile Java 6 -ARG docker_build_image=ghcr.io/openzipkin/java:11.0.22_p7 +ARG docker_build_image=ghcr.io/openzipkin/java:11.0.23_p9 # We copy files from the context into a scratch container first to avoid a problem where docker and # docker-compose don't share layer hashes https://github.com/docker/compose/issues/883 normally. diff --git a/jersey2-cassandra3/pom.xml b/jersey2-cassandra3/pom.xml index dd91f74..2f619e3 100644 --- a/jersey2-cassandra3/pom.xml +++ b/jersey2-cassandra3/pom.xml @@ -21,11 +21,11 @@ 8 - 2.41 - 5.3.31 + 2.43 + 5.3.34 - 4.1.3 - 3.11.2 + 4.1.4 + 3.11.5 0.13.1 diff --git a/netty4-grpc/README.md b/netty4-grpc/README.md index 5103f55..1458d13 100644 --- a/netty4-grpc/README.md +++ b/netty4-grpc/README.md @@ -1,4 +1,4 @@ -## Tracing Example: Netty 4.1/Google gRPC 1.34/JRE 21 +## Tracing Example: Netty 4.1/Google gRPC 1.63/JRE 21 Instead of servlet, the frontend is a Netty HTTP handler. The backend is Google gRPC 1.31. Both services run as a normal Java application. @@ -7,7 +7,7 @@ Both services run as a normal Java application. * [brave.example.Backend](src/main/java/brave/example/Backend.java) - Google gRPC server * [brave.example.TracingConfiguration](src/main/java/brave/example/TracingConfiguration.java) - Configures trace instrumentation -Here's an example screen shot: +Here's an example screenshot: ![screen shot](https://user-images.githubusercontent.com/64215/102683005-a2986500-4208-11eb-8258-92cc02f9310b.png) This example also shows Brave's `BaggagePropagation`. If you make a request to the frontend with diff --git a/netty4-grpc/pom.xml b/netty4-grpc/pom.xml index 7662954..62819f7 100644 --- a/netty4-grpc/pom.xml +++ b/netty4-grpc/pom.xml @@ -14,14 +14,14 @@ jar brave-example-netty4-grpc - Tracing Example: Netty 4.1/Google gRPC 1.34/JRE 21 + Tracing Example: Netty 4.1/Google gRPC 1.63/JRE 21 21 8 - 1.34.1 - 3.12.0 + 1.63.0 + 3.25.1 1.7.1 0.6.1 @@ -33,6 +33,11 @@ grpc-services ${grpc.version} + + io.grpc + grpc-protobuf + ${grpc.version} + io.grpc grpc-netty @@ -63,7 +68,7 @@ io.zipkin.brave - brave-context-slf4j + brave-context-log4j12 diff --git a/netty4-grpc/src/main/java/brave/example/Backend.java b/netty4-grpc/src/main/java/brave/example/Backend.java index 9fada7d..3ce77ab 100644 --- a/netty4-grpc/src/main/java/brave/example/Backend.java +++ b/netty4-grpc/src/main/java/brave/example/Backend.java @@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception { /** * Google's gRPC impl disallows reading headers inside a server handler. This copies a header into - * the context so we can see if it was propagated or not. + * the context, so we can see if it was propagated or not. */ static final class CopyHeaderToGrpcContext implements ServerInterceptor { final Key contextKey; diff --git a/netty4-grpc/src/main/java/brave/example/TracingConfiguration.java b/netty4-grpc/src/main/java/brave/example/TracingConfiguration.java index 8859fe6..a2800e4 100644 --- a/netty4-grpc/src/main/java/brave/example/TracingConfiguration.java +++ b/netty4-grpc/src/main/java/brave/example/TracingConfiguration.java @@ -5,7 +5,7 @@ import brave.baggage.BaggagePropagation; import brave.baggage.BaggagePropagationConfig; import brave.baggage.CorrelationScopeConfig; -import brave.context.slf4j.MDCScopeDecorator; +import brave.context.log4j12.MDCScopeDecorator; import brave.grpc.GrpcTracing; import brave.http.HttpTracing; import brave.netty.http.NettyHttpTracing; diff --git a/netty4-grpc/src/main/java/brave/example/generated/BackendGrpc.java b/netty4-grpc/src/main/java/brave/example/generated/BackendGrpc.java index bfade8c..e0607cc 100644 --- a/netty4-grpc/src/main/java/brave/example/generated/BackendGrpc.java +++ b/netty4-grpc/src/main/java/brave/example/generated/BackendGrpc.java @@ -1,30 +1,18 @@ package brave.example.generated; import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; /** */ @javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.31.1)", + value = "by gRPC proto compiler (version 1.63.0)", comments = "Source: backend.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class BackendGrpc { private BackendGrpc() {} - public static final String SERVICE_NAME = "brave.example.Backend"; + public static final java.lang.String SERVICE_NAME = "brave.example.Backend"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor responseObserver) { - asyncUnimplementedUnaryCall(getPrintDateMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPrintDateMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Backend. + */ + public static abstract class BackendImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getPrintDateMethod(), - asyncUnaryCall( - new MethodHandlers< - brave.example.generated.BackendProto.Empty, - brave.example.generated.BackendProto.Reply>( - this, METHODID_PRINT_DATE))) - .build(); + return BackendGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service Backend. */ - public static final class BackendStub extends io.grpc.stub.AbstractAsyncStub { + public static final class BackendStub + extends io.grpc.stub.AbstractAsyncStub { private BackendStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -144,14 +133,16 @@ protected BackendStub build( */ public void printDate(brave.example.generated.BackendProto.Empty request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getPrintDateMethod(), getCallOptions()), request, responseObserver); } } /** + * A stub to allow clients to do synchronous rpc calls to service Backend. */ - public static final class BackendBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class BackendBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private BackendBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -166,14 +157,16 @@ protected BackendBlockingStub build( /** */ public brave.example.generated.BackendProto.Reply printDate(brave.example.generated.BackendProto.Empty request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getPrintDateMethod(), getCallOptions(), request); } } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Backend. */ - public static final class BackendFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class BackendFutureStub + extends io.grpc.stub.AbstractFutureStub { private BackendFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -189,7 +182,7 @@ protected BackendFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture printDate( brave.example.generated.BackendProto.Empty request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getPrintDateMethod(), getCallOptions()), request); } } @@ -201,10 +194,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final BackendImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(BackendImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -233,6 +226,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getPrintDateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + brave.example.generated.BackendProto.Empty, + brave.example.generated.BackendProto.Reply>( + service, METHODID_PRINT_DATE))) + .build(); + } + private static abstract class BackendBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { BackendBaseDescriptorSupplier() {} @@ -256,9 +261,9 @@ private static final class BackendFileDescriptorSupplier private static final class BackendMethodDescriptorSupplier extends BackendBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; + private final java.lang.String methodName; - BackendMethodDescriptorSupplier(String methodName) { + BackendMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } diff --git a/netty4-grpc/src/main/java/brave/example/generated/BackendProto.java b/netty4-grpc/src/main/java/brave/example/generated/BackendProto.java index 0c74497..42b48ba 100644 --- a/netty4-grpc/src/main/java/brave/example/generated/BackendProto.java +++ b/netty4-grpc/src/main/java/brave/example/generated/BackendProto.java @@ -1,6 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: backend.proto +// Protobuf Java Version: 3.25.1 package brave.example.generated; public final class BackendProto { @@ -44,48 +45,6 @@ protected java.lang.Object newInstance( return new Empty(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Empty( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - 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 (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - 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 brave.example.generated.BackendProto.internal_static_brave_example_Empty_descriptor; @@ -113,7 +72,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -122,7 +81,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -137,7 +96,7 @@ public boolean equals(final java.lang.Object obj) { } brave.example.generated.BackendProto.Empty other = (brave.example.generated.BackendProto.Empty) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -148,7 +107,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -197,11 +156,13 @@ public static brave.example.generated.BackendProto.Empty parseFrom( return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } + public static brave.example.generated.BackendProto.Empty parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } + public static brave.example.generated.BackendProto.Empty parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -269,18 +230,13 @@ public static final class Builder extends // Construct using brave.example.generated.BackendProto.Empty.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } @java.lang.Override public Builder clear() { @@ -359,7 +315,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(brave.example.generated.BackendProto.Empty other) { if (other == brave.example.generated.BackendProto.Empty.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -374,17 +330,30 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - brave.example.generated.BackendProto.Empty parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (brave.example.generated.BackendProto.Empty) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @java.lang.Override @@ -420,7 +389,18 @@ public Empty parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Empty(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -479,54 +459,6 @@ protected java.lang.Object newInstance( return new Reply(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Reply( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - 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; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - message_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - 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 brave.example.generated.BackendProto.internal_static_brave_example_Reply_descriptor; @@ -541,7 +473,8 @@ private Reply( } public static final int MESSAGE_FIELD_NUMBER = 1; - private volatile java.lang.Object message_; + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; /** * string message = 1; * @return The message. @@ -592,10 +525,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getMessageBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -604,10 +537,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getMessageBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -624,7 +557,7 @@ public boolean equals(final java.lang.Object obj) { if (!getMessage() .equals(other.getMessage())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -637,7 +570,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + MESSAGE_FIELD_NUMBER; hash = (53 * hash) + getMessage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -686,11 +619,13 @@ public static brave.example.generated.BackendProto.Reply parseFrom( return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } + public static brave.example.generated.BackendProto.Reply parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } + public static brave.example.generated.BackendProto.Reply parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -754,24 +689,19 @@ public static final class Builder extends // Construct using brave.example.generated.BackendProto.Reply.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; message_ = ""; - return this; } @@ -798,11 +728,18 @@ public brave.example.generated.BackendProto.Reply build() { @java.lang.Override public brave.example.generated.BackendProto.Reply buildPartial() { brave.example.generated.BackendProto.Reply result = new brave.example.generated.BackendProto.Reply(this); - result.message_ = message_; + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } + private void buildPartial0(brave.example.generated.BackendProto.Reply result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.message_ = message_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -849,9 +786,10 @@ public Builder mergeFrom(brave.example.generated.BackendProto.Reply other) { if (other == brave.example.generated.BackendProto.Reply.getDefaultInstance()) return this; if (!other.getMessage().isEmpty()) { message_ = other.message_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -866,19 +804,38 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - brave.example.generated.BackendProto.Reply parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (brave.example.generated.BackendProto.Reply) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; private java.lang.Object message_ = ""; /** @@ -921,11 +878,9 @@ public java.lang.String getMessage() { */ public Builder setMessage( java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + if (value == null) { throw new NullPointerException(); } message_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -934,8 +889,8 @@ public Builder setMessage( * @return This builder for chaining. */ public Builder clearMessage() { - message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -946,12 +901,10 @@ public Builder clearMessage() { */ public Builder setMessageBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); message_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -988,7 +941,18 @@ public Reply parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Reply(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/netty4-grpc/src/main/resources/log4j.properties b/netty4-grpc/src/main/resources/log4j.properties new file mode 100644 index 0000000..3d02dc2 --- /dev/null +++ b/netty4-grpc/src/main/resources/log4j.properties @@ -0,0 +1,5 @@ +log4j.rootLogger=INFO, stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} [%X{userName}] [%X{traceId}/%X{spanId}] %-5p [%t] %C{2} (%F:%L) - %m%n diff --git a/netty4-grpc/src/main/resources/logback.xml b/netty4-grpc/src/main/resources/logback.xml deleted file mode 100644 index ec20f47..0000000 --- a/netty4-grpc/src/main/resources/logback.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - %d{HH:mm:ss.SSS} [%thread] [%X{userName}] [%X{traceId}/%X{spanId}] %-5level %logger{36} - %msg%n - - - - - - - diff --git a/parent-pom.xml b/parent-pom.xml index b62e292..70a58d4 100644 --- a/parent-pom.xml +++ b/parent-pom.xml @@ -41,13 +41,13 @@ ${jre.version} - 3.1.1 + 3.2.0 1.2.8 - 3.12.1 + 3.13.0 3.6.1 3.4.0 - 3.3.0 + 3.4.1 3.4.0 diff --git a/webflux5-sleuth/pom.xml b/webflux5-sleuth/pom.xml index 4e204ee..da9e836 100644 --- a/webflux5-sleuth/pom.xml +++ b/webflux5-sleuth/pom.xml @@ -21,7 +21,7 @@ 8 - 2.6.15 + 2.7.18 3.1.11 3.1.8 diff --git a/webflux6-micrometer/pom.xml b/webflux6-micrometer/pom.xml index f08598a..4d08164 100644 --- a/webflux6-micrometer/pom.xml +++ b/webflux6-micrometer/pom.xml @@ -19,8 +19,8 @@ 21 17 - 3.3.0-M2 - 1.3.0-M1 + 3.3.0-RC1 + 1.3.0 diff --git a/webmvc4-jetty/pom.xml b/webmvc4-jetty/pom.xml index 9944336..bb60297 100755 --- a/webmvc4-jetty/pom.xml +++ b/webmvc4-jetty/pom.xml @@ -19,7 +19,7 @@ 8 7 - 4.3.29.RELEASE + 4.3.30.RELEASE 1.7.36 org.eclipse.jetty