[ 
https://issues.apache.org/jira/browse/CAMEL-26187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-26187.
---------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/camel/pull/29012 (merged to main as 
6a7e17a1af69408bc004b8a0653ff7623c41639f).

_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