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

Claus Ibsen updated CAMEL-27850:
--------------------------------
    Description: 
Found while improving the option descriptions of camel-dapr for CAMEL-23832 
(commit 
https://github.com/apache/camel/commit/f9e89282ea330ac399422c39806c46d8db9c4777,
 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).
Proposed change: use the CamelContext ClassResolver.


_Claude Code on behalf of davsclaus_

  was:
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).
Proposed change: use the CamelContext ClassResolver.


_Claude Code on behalf of davsclaus_


> 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
>            Priority: Minor
>             Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-dapr for CAMEL-23832 
> (commit 
> https://github.com/apache/camel/commit/f9e89282ea330ac399422c39806c46d8db9c4777,
>  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).
> Proposed change: use the CamelContext ClassResolver.
> _Claude Code on behalf of davsclaus_



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

Reply via email to