@Override
                    public void onNext(HelloRequest request) {
                        requestCount++;

                        // Process the request and send a response or an error.
                        try {
                            // Accept and enqueue the request.
                            String name = request.getName();
                            logger.info("--> " + name);

                            // Simulate server "work"
                            Thread.sleep(100);

                            // Send a response.
                            String message = "Hello " + name;
                            logger.info("<-- " + message);
                            HelloReply reply = HelloReply.newBuilder().setMessage(message).build();
                            responseObserver.onNext(reply);

                            // Check the provided ServerCallStreamObserver to see if it is still ready to accept more messages.
                            if (serverCallStreamObserver.isReady()) {
                                // Signal the sender to send another request. As long as isReady() stays true, the server will keep
                                // cycling through the loop of onNext() -> request()...onNext() -> request()... until either the client
                                // runs out of messages and ends the loop or the server runs out of receive buffer space.
                                //
                                // If the server runs out of buffer space, isReady() will turn false. When the receive buffer has
                                // sufficiently drained, isReady() will turn true, and the serverCallStreamObserver's onReadyHandler
                                // will be called to restart the message pump.
                                serverCallStreamObserver.request(1);
                            } else {
                                // If not, note that back-pressure has begun.
                                wasReady.set(false);
                            }
                        } catch (Throwable throwable) {
                            throwable.printStackTrace();
                            responseObserver.onError(
                                    Status.UNKNOWN.withDescription("Error handling request").withCause(throwable).asException());
                        }
                    }
copy grpc framework
- https://github.com/grpc/grpc-java/blob/master/examples/src/main/java/io/grpc/examples/manualflowcontrol/ManualFlowControlServer.java
agent-module/plugins-it/google-grpc-it/google-grpc-1-8-it/src/test/java/com/navercorp/pinpoint/it/plugin/grpc/HelloWorldStreamServer.java