Claus Ibsen created CAMEL-27625:
-----------------------------------

             Summary: camel-ibm-watson-speech-to-text: health check options 
unused, unused label, header metadata
                 Key: CAMEL-27625
                 URL: https://issues.apache.org/jira/browse/CAMEL-27625
             Project: Camel
          Issue Type: Bug
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while improving the option descriptions of 
camel-ibm-watson-speech-to-text for CAMEL-23832 (PR 
https://github.com/apache/camel/pull/30964).
These are separate problems of the component; the descriptions PR only 
documents the current behavior.

h4. 1. The health check options do nothing
{{WatsonSpeechToTextComponent}} extends {{HealthCheckComponent}}, so the 
component has the {{healthCheckConsumerEnabled}} and 
{{healthCheckProducerEnabled}} options. The module has no health check: there 
is no {{HealthCheck}} class and the endpoint does not register one. Setting 
these options has no effect, and the health check of Camel never reports the 
state of the Speech to Text client.
Proposed change: add a producer health check that calls the service (for 
example {{listModels}}), or extend {{DefaultComponent}} so that the options go 
away.

h4. 2. The required {{label}} path is not used
{{WatsonSpeechToTextEndpoint}} declares {{label}} as a required {{@UriPath}}, 
but only {{getLabel()}} and {{setLabel()}} touch it. The value does not change 
what the producer does, which can make users expect that it selects a service 
instance or a model.
Proposed change: document it as a free logical name (done in the descriptions 
PR), or give it a meaning, for example the default operation as in other 
components.

h4. 3. {{serviceUrl}} has the label {{common}}
{{WatsonSpeechToTextConfiguration.serviceUrl}} has {{@UriParam(label = 
"common")}}, but the endpoint is {{producerOnly = true}}. The option is shown 
under common in the docs and the tooling.
Proposed change: use {{label = "producer"}}.

h4. 4. The headers have no {{producer}} label
None of the {{@Metadata}} fields in {{WatsonSpeechToTextConstants}} has a 
label, so the catalog does not show which side reads or sets them. The producer 
reads all of them except {{CamelIBMWatsonSTTTranscript}}, which it sets, and it 
also sets {{CamelIBMWatsonSTTModel}} and {{CamelIBMWatsonSTTContentType}} on 
the result.
Proposed change: add {{label = "producer"}} to the headers.

h4. 5. {{CamelIBMWatsonSTTModelName}} is also the customization ID
{{WatsonSpeechToTextProducer.getCustomModel()}} reads the 
{{CamelIBMWatsonSTTModelName}} header as the customization ID (a GUID) of a 
custom language model and passes it to 
{{GetLanguageModelOptions.customizationId()}}. The name of the header and its 
old description suggest a model name, as for {{getModel()}}.
Proposed change: add a {{CamelIBMWatsonSTTCustomizationId}} header for 
{{getCustomModel}} and keep {{CamelIBMWatsonSTTModelName}} as a fallback.

_Claude Code on behalf of davsclaus_



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

Reply via email to