jamesnetherton commented on issue #7897:
URL: https://github.com/apache/camel-quarkus/issues/7897#issuecomment-3480980023

   Digging a bit more. We are perhaps not defining the `StreamObserver` 
correctly in the test .
   
   
[JavaDoc](https://grpc.github.io/grpc-java/javadoc/io/grpc/stub/StreamObserver.html#onNext(V))
 about `StreamObserver.onNext` states:
   
   > If an exception is thrown by an implementation the caller is expected to 
terminate the stream by calling onError(Throwable) with the caught exception 
prior to propagating it.
   
   So we should perhaps in `PongResponseStreamObserver.onNext` be doing:
   
   ```java
   if (simulateError) {
       onError(new IllegalStateException("Forced exception"));
       // Maybe also throw & propagate the exception here 
   }
   ```
   
   Otherwise it is not guaranteed that gRPC will call onError itself internally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to