Class GrpcMethodHandler
- java.lang.Object
-
- org.apache.camel.component.grpc.server.GrpcMethodHandler
-
public class GrpcMethodHandler extends Object
Handles gRPC service method invocations
-
-
Field Summary
Fields Modifier and Type Field Description protected GrpcConsumerconsumer
-
Constructor Summary
Constructors Constructor Description GrpcMethodHandler(GrpcConsumer consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(Object body, io.grpc.stub.StreamObserver<Object> responseObserver, String methodName)This method deals with the unary and server streaming gRPC callsio.grpc.stub.StreamObserver<Object>handleForConsumerStrategy(io.grpc.stub.StreamObserver<Object> responseObserver, String methodName)This method deals with the client streaming and bi-directional streaming gRPC calls
-
-
-
Field Detail
-
consumer
protected final GrpcConsumer consumer
-
-
Constructor Detail
-
GrpcMethodHandler
public GrpcMethodHandler(GrpcConsumer consumer)
-
-
Method Detail
-
handle
public void handle(Object body, io.grpc.stub.StreamObserver<Object> responseObserver, String methodName) throws Exception
This method deals with the unary and server streaming gRPC calls- Parameters:
body- The request object sent by the gRPC client to the serverresponseObserver- The response stream observermethodName- The name of the method invoked using the stub.- Throws:
Exception- java.lang.Exception
-
handleForConsumerStrategy
public io.grpc.stub.StreamObserver<Object> handleForConsumerStrategy(io.grpc.stub.StreamObserver<Object> responseObserver, String methodName)
This method deals with the client streaming and bi-directional streaming gRPC calls- Parameters:
responseObserver- The response stream observermethodName- The name of the method invoked using the stub.- Returns:
- Request stream observer
-
-