Claus Ibsen created CAMEL-27850:
-----------------------------------

             Summary: camel-dapr: the CamelDaprTimeout header is never read, 
getWorkflowIO has no effect, PATCH becomes NONE
                 Key: CAMEL-27850
                 URL: https://issues.apache.org/jira/browse/CAMEL-27850
             Project: Camel
          Issue Type: Bug
          Components: camel-dapr
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-dapr for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31144).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. The CamelDaprTimeout header is never read
{{DaprExchangeHeaders.getTimeoutFromHeaders}} reads 
DaprConstants.GET_WORKFLOW_IO instead of TIMEOUT, so waitForInstanceStart and 
waitForInstanceCompletion fail with "Timeout must not be empty" unless the 
timeout option is set. The doc examples use the header.
Proposed change: read DaprConstants.TIMEOUT.

h4. 2. The getWorkflowIO option has no effect
getWorkflowIOFromHeaders reads the header as boolean.class, and a missing 
header gives Boolean.FALSE, which is not empty, so 
DaprConfigurationOptionsProxy never falls back to the option.
Proposed change: read the header as Boolean.class.

h4. 3. PATCH and unknown verbs become HttpExtension.NONE
{{DaprTypeConverter.toHttpExtension}} has no case for PATCH 
(HttpExtension.PATCH exists in SDK 1.19.0); PATCH and any unknown text silently 
become NONE.
Proposed change: add PATCH and throw on unknown verbs.

h4. 4. verb must be upper case
{{DaprServiceInvocationHandler}} uses DaprHttp.HttpMethods.valueOf(verb), so 
verb=get fails with IllegalArgumentException.
Proposed change: upper-case the value.

h4. 5. The pubsub consumer skips its checks with a preview client
{{DaprPubSubConsumer.doInit}} skips the pubSubName/topic check when a 
previewClient is configured, and then subscribes with a null name or topic.
Proposed change: always check.

h4. 6. The workflow class is loaded with Class.forName
{{DaprWorkflowHandler.resolveWorkflowClass}} uses Class.forName instead of the 
CamelContext ClassResolver, which can fail with isolated class loaders 
(Quarkus), and initializes the class before checking that it is a Workflow.
Proposed change: use the ClassResolver, without initializing the class before 
the type check.


_Claude Code on behalf of davsclaus_



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

Reply via email to