[
https://issues.apache.org/jira/browse/CAMEL-26263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137278#comment-18137278
]
Claus Ibsen commented on CAMEL-26263:
-------------------------------------
PR: https://github.com/apache/camel/pull/29105
It registers the secret handler, keeps the message headers and adds the
response headers, and converts a String, InputStream or Reader body to bytes
for invokeService, pubSub, invokeBinding and state save. The workflow
operations keep giving the body as is to the workflow client, which serializes
it for the typed workflow input. An upgrade guide entry covers the kept headers
and the text bodies no longer being sent as a quoted JSON string.
_Claude Code on behalf of Claus Ibsen (davsclaus)_
> camel-dapr - the secret operation always fails with No handler for operation
> secret, and the producer replaces all message headers
> ----------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-26263
> URL: https://issues.apache.org/jira/browse/CAMEL-26263
> Project: Camel
> Issue Type: Bug
> Components: camel-dapr
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.24.0
>
>
> Found while adding the catalog body types of dapr (CAMEL-24961, PR #28409).
> h4. 1. dapr:secret always fails
> {{DaprOperationManager}} (main 2a465aa4814c, lines 34-40) registers a handler
> for every operation except {{secret}}, so every {{dapr:secret}} call fails
> with {{UnsupportedOperationException: No handler for operation secret}} (line
> 48). {{DaprSecretHandler}} exists, and its unit tests call it directly, so
> they pass. Checked on 4.24.0-SNAPSHOT with a Mockito {{DaprClient}} on the
> URI.
> Proposed: register {{DaprSecretHandler}} for {{DaprOperation.secret}}, and
> add a test through the endpoint.
> h4. 2. The producer replaces all message headers
> {{DaprProducer.setResponse}} (line 48) calls
> {{setHeaders(response.getHeaders())}}, so every header set before the call is
> gone afterwards. Checked on 4.24.0-SNAPSHOT with the mock client.
> Proposed: add the response headers to the existing ones
> ({{getHeaders().putAll(...)}}).
> h4. 3. A stream body fails, and a text body is sent as a JSON string
> The handlers pass {{getIn().getBody()}} as it is to the {{DaprClient}} (e.g.
> {{DaprServiceInvocationHandler}}, line 42), whose Jackson serializer fails
> for an {{InputStream}} and sends a String as a JSON-quoted string
> ({{"hello"}} with the quotes). Checked on 4.24.0-SNAPSHOT with the mock
> client.
> Proposed: convert stream and String bodies to byte[] (sent as is) before the
> call.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)