shashank created CAMEL-27208:
--------------------------------
Summary: camel-grpc - a producer with streamRepliesTo completes a
failed call as a success, so the error is lost
Key: CAMEL-27208
URL: https://issues.apache.org/jira/browse/CAMEL-27208
Project: Camel
Issue Type: Bug
Components: camel-grpc
Reporter: shashank
Assignee: shashank
h3. What happens
A gRPC producer with {{streamRepliesTo}} and the SIMPLE producer strategy (the
default) routes the responses of a call to another endpoint with
{{GrpcResponseRouterStreamObserver}}, which also completes the exchange that
made the call when the call ends. When the call fails (server not reachable,
deadline exceeded, an error status from the server), {{onError}} completes the
exchange without setting the exception. With {{forwardOnError=false}} (the
default) the error is not routed anywhere either: the exchange completes as a
success, no error handler or redelivery runs, and nothing is logged. A route
such as
{{from(...).to("grpc://host:port/pkg.Service?method=x&streamRepliesTo=direct:replies")}}
loses every failed call without a trace.
Without {{streamRepliesTo}} ({{GrpcResponseAggregationStreamObserver}}) the
exchange does fail.
h3. How to reproduce
{{GrpcProducerStreamRepliesToTest}} (camel-grpc, in-JVM gRPC server on a free
port): a call that the server fails with UNAVAILABLE, and a call to a port
nothing listens on, complete without an exception.
h3. Fix
{{GrpcResponseRouterStreamObserver.onError}} sets the error on the exchange of
the call when it is not routed to the replies endpoint (SIMPLE strategy). With
{{forwardOnError=true}} the error is routed to the replies endpoint as before
and the exchange completes. STREAMING is not changed: its exchanges are
completed when they are sent on the stream.
_Filed with Claude Code on behalf of allthingssecurity._
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)