Claus Ibsen created CAMEL-25652:
-----------------------------------

             Summary: Component metadata: an internal flag, next to remote, for 
components that only reach the CamelContext
                 Key: CAMEL-25652
                 URL: https://issues.apache.org/jira/browse/CAMEL-25652
             Project: Camel
          Issue Type: Improvement
          Components: camel-catalog, camel-jbang, tooling
            Reporter: Claus Ibsen
             Fix For: 4.24.0


The component metadata has one dimension for where a component reaches: 
{{@UriEndpoint(remote = ...)}}, published as {{"remote"}} in the catalog JSON 
and as {{Endpoint.isRemote()}}. 69 of the 412 components are {{remote: false}}, 
and they are of two kinds:

* components that stay inside the CamelContext: its routes and in-memory 
queues, its log, the test endpoints (direct, seda, disruptor, disruptor-vm, 
log, mock, stub, browse, dataset, dataset-test, the caffeine caches, the 
metrics components, event)
* components that reach the machine they run on: they run code (exec, shell, 
class, bean, language, mvel, wasm), load a template, stylesheet or schema by 
URI and so read a file or fetch a URL (velocity, freemarker, mustache, 
thymeleaf, xslt, xquery, validator, json-validator, jolt, jslt and others), or 
drive the JVM (jmx, controlbus)

The labels do not tell them apart either: exec is "core", and the template 
components share "transformation" with plain mappers.

Tooling needs the difference. The AI tools of Camel TUI send a message to an 
endpoint without asking when it stays inside the integration (a test message to 
log: or direct: should not need a confirmation), and ask the user first 
otherwise. For now the TUI keeps its own list of internal components 
({{ToolConfirms.INTERNAL_SCHEMES}}); camel-jbang-mcp has the same need.

Proposal, a positive flag next to remote:
* {{@UriEndpoint(internal = true)}}: the endpoint only reaches the CamelContext 
(its routes, in-memory state and log), and no file, process, code, or resource 
named in the URI. It implies {{remote = false}}.
* Published in the catalog JSON as {{"internal": true}} and in 
{{ComponentModel}}; maybe also a default {{Endpoint.isInternal()}}.
* False by default, so a new component is not internal until its author says 
so. Marking the other side instead (such as {{hostAccess = true}}) fails open 
when it is forgotten.
* Set on the components in the first bullet above.

The TUI and camel-jbang-mcp then read it from the catalog of the integration's 
Camel version, with their own list as the fallback for older catalogs. A 
runtime use could follow: with the prod profile, a warning when a toD or a 
recipient list resolves a URI built from message data to a component that is 
neither remote nor internal.

An alternative is a three-way reach (context, host, network) in place of 
remote. It models it better, but {{Endpoint.isRemote()}} is public API, so the 
additive flag is the smaller change.

_Claude Code on behalf of Claus Ibsen_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to