Claus Ibsen created CAMEL-24658:
-----------------------------------
Summary: camel-catalog - find components by protocol or product
name (s3 -> aws2-s3, mqtt -> paho-mqtt5)
Key: CAMEL-24658
URL: https://issues.apache.org/jira/browse/CAMEL-24658
Project: Camel
Issue Type: Improvement
Components: camel-catalog
Reporter: Claus Ibsen
Users, and AI models driving Camel through tooling, refer to components by the
protocol or product name rather than the Camel scheme: *mqtt* (the component is
{{paho-mqtt5}}), *s3* ({{aws2-s3}}), *rabbitmq* ({{spring-rabbitmq}}), *pubsub*
({{google-pubsub}}), *servicebus* ({{azure-servicebus}}). Today the catalog can
only be queried by exact scheme, so each tool has to keep its own alias list
(the Camel TUI AI panel currently hardcodes one to turn a failed {{mqtt:...}}
send into a hint for {{paho-mqtt5:...}}).
Most of the data to answer this already exists in the catalog. Checking the 406
component JSON files on main, matching a term against (1) the scheme, (2)
{{alternativeSchemes}}, (3) the words of the {{title}} gives:
||Term||Matches (in rank order)||
|s3|aws2-s3, aws2-s3-vectors|
|sqs|aws2-sqs|
|mqtt|paho-mqtt5|
|rabbitmq|spring-rabbitmq|
|pubsub|google-pubsub|
|servicebus|azure-servicebus|
|kafka|kafka, aws2-msk|
|https|https, http|
|jms|jms, sjms|
|amq|(none)|
Proposal:
# Add a term-based lookup to {{CamelCatalog}}, for example {{List<String>
findComponentNames(String term)}} or {{suggestComponents(String term)}}, that
ranks matches: exact scheme first, then {{alternativeSchemes}}, then title
words, then scheme words (split on {{-}}), and lets callers cap the result (a
term like {{aws}} matches 37 components).
# Add an optional {{aliases}} attribute to the component metadata (from an
optional attribute on the {{@UriEndpoint}} annotation, or the component's
pom/metadata) for the shorthands titles cannot provide, e.g. {{amq}} ->
activemq, and include it in the ranking between alternative schemes and title
words.
# The same idea applies to data formats and languages by title (e.g. *yaml* ->
{{snakeyaml}}), and to kamelets through their declared {{dependencies}} (e.g.
{{mqtt5-source}} depends on {{camel:paho-mqtt5}}), which tooling can use to
resolve the component behind a kamelet.
Consumers: {{camel catalog}} in camel-jbang, the TUI AI panel and its MCP tools
(which can then drop the hardcoded alias map), IDE tooling.
No new dependencies; the lookup works on the existing JSON so it also serves
older catalog versions loaded through {{CatalogLoader}}.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)