Claus Ibsen created CAMEL-26325:
-----------------------------------

             Summary: camel-jbang - Export should resolve the delegate endpoint 
of a webhook: endpoint
                 Key: CAMEL-26325
                 URL: https://issues.apache.org/jira/browse/CAMEL-26325
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Follow-up of CAMEL-26116 (and CAMEL-25186), found while reviewing 
https://github.com/apache/camel/pull/28489.

The {{webhook}} component wraps a delegate endpoint, like {{master}} and 
{{zookeeper-master}}: {{webhook:<delegate-uri>}}. 
{{WebhookEndpoint.afterPropertiesConfigured}} creates the delegate with 
{{getCamelContext().getEndpoint(configuration.getEndpointUri())}}. During 
{{camel export}} the webhook endpoint is a stub, so the delegate endpoint is 
never created and its component is not added to the exported project.

*Reproduce* (checked with the released Camel CLI 4.22.2):

{code:yaml}
- route:
    from:
      uri: webhook:telegram:bots
      parameters:
        authorizationToken: "{{token}}"
      steps:
        - log: "${body}"
{code}

{code}
camel export --runtime=camel-main --gav=com.foo:acme:1.0 --dir=out route.yaml 
application.properties
{code}

The exported {{pom.xml}} has {{camel-webhook}} but not {{camel-telegram}}, so 
the exported project fails at startup.

*Proposed change*

In {{DownloadEndpointStrategy.registerEndpoint}} (camel-kamelet-main), resolve 
the delegate of a stubbed {{webhook:}} endpoint during export, as is now done 
for {{master:}} / {{zookeeper-master:}}. The URI shape differs: there is no 
namespace part, and the delegate is the whole remaining part 
({{WebhookComponent.createEndpoint}} uses {{remaining}} and appends the query 
parameters). So it needs its own extraction rather than the existing 
{{extractDelegateUri}}. Add a case to {{ExportTest}} for camel-main, Spring 
Boot and Quarkus.

_Claude Code on behalf of davsclaus_



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

Reply via email to