[
https://issues.apache.org/jira/browse/CAMEL-25186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18121183#comment-18121183
]
Serdar Gökay commented on CAMEL-25186:
--------------------------------------
We tested an approach locally and would like to send a PR.
{{DownloadEndpointStrategy}}, which already resolves what {{language:}} and
{{dataformat:}} URIs embed (CAMEL-22015), would also resolve the delegate
endpoint of a {{master:}} URI, split as {{MasterComponent.createEndpoint}}
splits it. {{master}} stays stubbed, so export still needs no cluster service.
On 4.22.1 this adds the timer dependency to camel-main, Spring Boot and Quarkus
exports and to {{camel dependency list}}, and the exported project starts and
ticks. {{camel run}} and {{camel transform route}} are unchanged.
One correction to the description: the variant {{uri: master:lock}} plus
{{parameters: delegateUri}} does not run under {{camel run}} either ({{Wrong
uri syntax}}), because the YAML DSL fills path options from {{parameters}} only
when {{uri}} is the bare scheme. The form that runs is {{uri: master}} with
{{namespace}} and {{delegateUri}}, and the change covers it.
{{zookeeper-master}} has the same shape; we can include it in the PR if you
want. Could you add me to the Contributors role and assign the issue to me?
Alternatively, other teams can use this comment while working.
> camel-jbang export - dependency of the delegate endpoint of a master:
> endpoint is not detected
> ----------------------------------------------------------------------------------------------
>
> Key: CAMEL-25186
> URL: https://issues.apache.org/jira/browse/CAMEL-25186
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Affects Versions: 4.22.1
> Reporter: Serdar Gökay
> Priority: Minor
>
> {{camel export}} and {{camel dependency list}} do not detect the component
> used by the delegate URI of a {{master:}} endpoint.
> During the silent export run, {{DependencyDownloaderComponentResolver}}
> (camel-kamelet-main) stubs every component outside {{ACCEPTED_STUB_NAMES}},
> including {{master}}. The stubbed {{MasterEndpoint}} therefore never calls
> {{getEndpoint(delegateUri)}}, so the delegate's component is never resolved
> and its artifact is never recorded. The exported project builds but fails at
> startup. {{camel run}} works because nothing is stubbed.
> *Reproducer*
> route.camel.yaml:
> {code:yaml}
> - route:
> from:
> uri: master:lock:timer:tick
> steps:
> - log: "tick"
> {code}
> application.properties:
> {code}
> camel.cluster.file.enabled=true
> camel.cluster.file.root=/tmp/master-repro
> {code}
> Steps:
> # {{camel run route.camel.yaml application.properties}} - works, logs "tick".
> # {{camel export route.camel.yaml application.properties --runtime=camel-main
> --gav=x:y:1.0 --dir=out}}
> # {{cd out && ./mvnw package && java -jar target/y-1.0.jar}}
> *Actual:* the pom contains camel-master but not camel-timer (same for {{camel
> dependency list}}). Startup fails with:
> {noformat}
> NoSuchEndpointException: No endpoint could be found for: timer://tick, please
> check your classpath contains the needed Camel component jar.
> {noformat}
> The same happens with {{uri: master:lock}} plus {{parameters: delegateUri:
> timer:tick}}.
> *Expected:* export includes the delegate's component (camel-timer), as it
> does for a plain {{timer:tick}} route and as {{camel run}} resolves it.
> Also reproduced from current main (4.23.0-SNAPSHOT). Related precedents for
> implied dependencies in the same resolver: CAMEL-21634 (cron -> quartz),
> CAMEL-24849.
> *Workaround:* pass the delegate component explicitly, e.g.
> {{--dep=org.apache.camel:camel-timer}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)