[ 
https://issues.apache.org/jira/browse/CAMEL-26187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136883#comment-18136883
 ] 

Claus Ibsen commented on CAMEL-26187:
-------------------------------------

PR: https://github.com/apache/camel/pull/29012

The consumer now converts each reply message to the response type of the called 
method (found from the generic type of its response StreamObserver). When that 
is not possible it sends nothing and ends the call with an INTERNAL status 
error. Applies to unary, server streaming, AGGREGATION and PROPAGATION. No body 
still sends an empty message. Upgrade guide entry added.

_Claude Code on behalf of Claus Ibsen (davsclaus)_

> camel-grpc - the consumer sends the reply without checking it against the 
> method response type: an unchanged request is decoded by the client as the 
> response
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26187
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26187
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-grpc
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> Found while adding the catalog body types of grpc (CAMEL-24961, PR #28413).
> h4. 1. The consumer reply is not checked against the response type
> {{GrpcMethodHandler}} (main 2a465aa4814c, line 71 to 77) passes the body 
> after the route to {{responseObserver.onNext}} as is. When the route leaves 
> the request body unchanged, the {{PingRequest}} is serialized and the client 
> decodes the bytes as a {{PongResponse}}: no error, a response with wrong 
> field values. A body of any other class is sent the same way. Checked on 
> 4.24.0-SNAPSHOT with an embedded gRPC netty server with a Camel consumer on 
> localhost.
> Proposed: convert the reply to the response type of the method (mandatory), 
> and fail the call with a status error when it is not that type.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to