[ 
https://issues.apache.org/jira/browse/CAMEL-25652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18127089#comment-18127089
 ] 

Claus Ibsen commented on CAMEL-25652:
-------------------------------------

PR: https://github.com/apache/camel/pull/27833

{{@UriEndpoint(internal = true)}}, published as {{"internal": true}} in the 
catalog JSON (written only on internal components) and 
{{ComponentModel.isInternal()}}. It implies {{remote = false}}; the build fails 
otherwise.

Internal is about what a component *can* do, not what it is usually used for: a 
capability counts even behind a seldom used option or in a feature the 
component ships with. With that rule, after a look at the code, 13 components 
are internal: direct, seda, stub, disruptor, disruptor-vm, log, mock, browse, 
caffeine-cache, caffeine-loadcache, metrics, event, timer.

Left out compared with the list in the description:
* dataset-test: polls the endpoint named in its URI ({{dataset-test:file:/dir}} 
moves the files it reads)
* dataset: ships FileDataSet, which reads a file
* micrometer, opentelemetry-metrics: evaluate their options with simple, which 
loads {{resource:file:}} and {{resource:http:}} text
* scheduler: can hand scheduling to Quartz, which can keep its jobs in a 
database

The TUI reads the flag from its own catalog instead of a list of its own (a 
component the catalog does not know asks first). {{Endpoint.isInternal()}} is 
left out until something at runtime needs it.

_Claude Code on behalf of Claus Ibsen_

> 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
>            Assignee: Claus Ibsen
>            Priority: Major
>             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