diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/EventmeshGrpc.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/EventmeshGrpc.java index 54a1ebdee9..4a93aaf22e 100644 --- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/EventmeshGrpc.java +++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/EventmeshGrpc.java @@ -127,7 +127,7 @@ public static void registerAllExtensions( "eartbeatItems\030\005 \003(\01327.eventmesh.common.p" + "rotocol.grpc.Heartbeat.HeartbeatItem\032+\n\r" + "HeartbeatItem\022\r\n\005topic\030\001 \001(\t\022\013\n\003url\030\002 \001(" + - "\t\"\036\n\nClientType\022\007\n\003PUB\020\000\022\007\n\003SUB\020\0012\266\003\n\020Pu" + + "\t\"\036\n\nClientType\022\007\n\003PUB\020\000\022\007\n\003SUB\020\0012\315\002\n\020Pu" + "blisherService\022e\n\007publish\0220.eventmesh.co" + "mmon.protocol.grpc.EventMeshMessage\032(.ev" + "entmesh.common.protocol.grpc.Response\022j\n" + @@ -136,23 +136,20 @@ public static void registerAllExtensions( "on.protocol.grpc.Response\022f\n\014batchPublis" + "h\022,.eventmesh.common.protocol.grpc.Batch" + "Message\032(.eventmesh.common.protocol.grpc" + - ".Response\022g\n\tbroadcast\0220.eventmesh.commo" + - "n.protocol.grpc.EventMeshMessage\032(.event" + - "mesh.common.protocol.grpc.Response2\322\002\n\017C" + - "onsumerService\022c\n\tsubscribe\022,.eventmesh." + - "common.protocol.grpc.Subscription\032(.even" + - "tmesh.common.protocol.grpc.Response\022s\n\017s" + - "ubscribeStream\022,.eventmesh.common.protoc" + - "ol.grpc.Subscription\0320.eventmesh.common." + - "protocol.grpc.EventMeshMessage0\001\022e\n\013unsu" + - "bscribe\022,.eventmesh.common.protocol.grpc" + - ".Subscription\032(.eventmesh.common.protoco" + - "l.grpc.Response2t\n\020HeartbeatService\022`\n\th" + - "eartbeat\022).eventmesh.common.protocol.grp" + - "c.Heartbeat\032(.eventmesh.common.protocol." + - "grpc.ResponseBC\n0org.apache.eventmesh.co" + - "mmon.protocol.grpc.protosB\rEventmeshGrpc" + - "P\001b\006proto3" + ".Response2\322\002\n\017ConsumerService\022c\n\tsubscri" + + "be\022,.eventmesh.common.protocol.grpc.Subs" + + "cription\032(.eventmesh.common.protocol.grp" + + "c.Response\022s\n\017subscribeStream\022,.eventmes" + + "h.common.protocol.grpc.Subscription\0320.ev" + + "entmesh.common.protocol.grpc.EventMeshMe" + + "ssage0\001\022e\n\013unsubscribe\022,.eventmesh.commo" + + "n.protocol.grpc.Subscription\032(.eventmesh" + + ".common.protocol.grpc.Response2t\n\020Heartb" + + "eatService\022`\n\theartbeat\022).eventmesh.comm" + + "on.protocol.grpc.Heartbeat\032(.eventmesh.c" + + "ommon.protocol.grpc.ResponseBC\n0org.apac" + + "he.eventmesh.common.protocol.grpc.protos" + + "B\rEventmeshGrpcP\001b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/PublisherServiceGrpc.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/PublisherServiceGrpc.java index 5730d78b95..46b48425fc 100644 --- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/PublisherServiceGrpc.java +++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/PublisherServiceGrpc.java @@ -83,28 +83,28 @@ Response> getRequestReplyMethod() { return getRequestReplyMethod; } - private static volatile io.grpc.MethodDescriptor getBatchPublishMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "batchPublish", - requestType = org.apache.eventmesh.common.protocol.grpc.protos.BatchMessage.class, + requestType = BatchMessage.class, responseType = Response.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getBatchPublishMethod() { - io.grpc.MethodDescriptor getBatchPublishMethod; + io.grpc.MethodDescriptor getBatchPublishMethod; if ((getBatchPublishMethod = PublisherServiceGrpc.getBatchPublishMethod) == null) { synchronized (PublisherServiceGrpc.class) { if ((getBatchPublishMethod = PublisherServiceGrpc.getBatchPublishMethod) == null) { PublisherServiceGrpc.getBatchPublishMethod = getBatchPublishMethod = - io.grpc.MethodDescriptor.newBuilder() + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "eventmesh.common.protocol.grpc.PublisherService", "batchPublish")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.apache.eventmesh.common.protocol.grpc.protos.BatchMessage.getDefaultInstance())) + BatchMessage.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( Response.getDefaultInstance())) .setSchemaDescriptor(new PublisherServiceMethodDescriptorSupplier("batchPublish")) @@ -115,38 +115,6 @@ Response> getBatchPublishMethod() { return getBatchPublishMethod; } - private static volatile io.grpc.MethodDescriptor getBroadcastMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "broadcast", - requestType = EventMeshMessage.class, - responseType = Response.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getBroadcastMethod() { - io.grpc.MethodDescriptor getBroadcastMethod; - if ((getBroadcastMethod = PublisherServiceGrpc.getBroadcastMethod) == null) { - synchronized (PublisherServiceGrpc.class) { - if ((getBroadcastMethod = PublisherServiceGrpc.getBroadcastMethod) == null) { - PublisherServiceGrpc.getBroadcastMethod = getBroadcastMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "eventmesh.common.protocol.grpc.PublisherService", "broadcast")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - EventMeshMessage.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - Response.getDefaultInstance())) - .setSchemaDescriptor(new PublisherServiceMethodDescriptorSupplier("broadcast")) - .build(); - } - } - } - return getBroadcastMethod; - } - /** * Creates a new async stub that supports all call types for the service */ @@ -190,18 +158,11 @@ public void requestReply(EventMeshMessage request, /** */ - public void batchPublish(org.apache.eventmesh.common.protocol.grpc.protos.BatchMessage request, - io.grpc.stub.StreamObserver responseObserver) { + public void batchPublish(BatchMessage request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getBatchPublishMethod(), responseObserver); } - /** - */ - public void broadcast(EventMeshMessage request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getBroadcastMethod(), responseObserver); - } - @Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -222,16 +183,9 @@ public void broadcast(EventMeshMessage request, getBatchPublishMethod(), asyncUnaryCall( new MethodHandlers< - org.apache.eventmesh.common.protocol.grpc.protos.BatchMessage, + BatchMessage, Response>( this, METHODID_BATCH_PUBLISH))) - .addMethod( - getBroadcastMethod(), - asyncUnaryCall( - new MethodHandlers< - EventMeshMessage, - Response>( - this, METHODID_BROADCAST))) .build(); } } @@ -272,19 +226,11 @@ public void requestReply(EventMeshMessage request, /** */ - public void batchPublish(org.apache.eventmesh.common.protocol.grpc.protos.BatchMessage request, - io.grpc.stub.StreamObserver responseObserver) { + public void batchPublish(BatchMessage request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getBatchPublishMethod(), getCallOptions()), request, responseObserver); } - - /** - */ - public void broadcast(EventMeshMessage request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getBroadcastMethod(), getCallOptions()), request, responseObserver); - } } /** @@ -321,17 +267,10 @@ public Response requestReply(EventMeshMessage request) { /** */ - public Response batchPublish(org.apache.eventmesh.common.protocol.grpc.protos.BatchMessage request) { + public Response batchPublish(BatchMessage request) { return blockingUnaryCall( getChannel(), getBatchPublishMethod(), getCallOptions(), request); } - - /** - */ - public Response broadcast(EventMeshMessage request) { - return blockingUnaryCall( - getChannel(), getBroadcastMethod(), getCallOptions(), request); - } } /** @@ -371,24 +310,15 @@ public com.google.common.util.concurrent.ListenableFuture requestReply /** */ public com.google.common.util.concurrent.ListenableFuture batchPublish( - org.apache.eventmesh.common.protocol.grpc.protos.BatchMessage request) { + BatchMessage request) { return futureUnaryCall( getChannel().newCall(getBatchPublishMethod(), getCallOptions()), request); } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture broadcast( - EventMeshMessage request) { - return futureUnaryCall( - getChannel().newCall(getBroadcastMethod(), getCallOptions()), request); - } } private static final int METHODID_PUBLISH = 0; private static final int METHODID_REQUEST_REPLY = 1; private static final int METHODID_BATCH_PUBLISH = 2; - private static final int METHODID_BROADCAST = 3; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -416,11 +346,7 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_BATCH_PUBLISH: - serviceImpl.batchPublish((org.apache.eventmesh.common.protocol.grpc.protos.BatchMessage) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_BROADCAST: - serviceImpl.broadcast((EventMeshMessage) request, + serviceImpl.batchPublish((BatchMessage) request, (io.grpc.stub.StreamObserver) responseObserver); break; default: @@ -487,7 +413,6 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getPublishMethod()) .addMethod(getRequestReplyMethod()) .addMethod(getBatchPublishMethod()) - .addMethod(getBroadcastMethod()) .build(); } } diff --git a/eventmesh-protocol-plugin/eventmesh-protocol-grpc/src/main/proto/eventmesh-client.proto b/eventmesh-protocol-plugin/eventmesh-protocol-grpc/src/main/proto/eventmesh-client.proto index 374ec2a288..911fc11cd7 100644 --- a/eventmesh-protocol-plugin/eventmesh-protocol-grpc/src/main/proto/eventmesh-client.proto +++ b/eventmesh-protocol-plugin/eventmesh-protocol-grpc/src/main/proto/eventmesh-client.proto @@ -122,8 +122,6 @@ service PublisherService { rpc requestReply(EventMeshMessage) returns (Response); rpc batchPublish(BatchMessage) returns (Response); - - rpc broadcast(EventMeshMessage) returns (Response); } service ConsumerService {