Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16303

URI generation: if a part of the component name is equal to a path parameter the URI generation will fail

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.7.3, 3.9.0
    • None
    • None
    • Unknown

    Description

      For example take this:

       

      ///usr/bin/env jbang "$0" "$@" ; exit $?
      //DEPS org.apache.camel:camel-core-engine:3.8.0
      //DEPS org.apache.camel:camel-main:3.8.0
      //DEPS org.apache.camel:camel-direct:3.8.0
      //DEPS org.apache.camel:camel-google-bigquery:3.8.0
      //DEPS org.slf4j:slf4j-nop:1.7.25
      import java.util.*;
      import org.apache.camel.*;
      import org.apache.camel.spi.*;
      import org.apache.camel.builder.RouteBuilder;
      import org.apache.camel.main.Main;
      Main main = new Main();
      main.configure().addRoutesBuilder(new RouteBuilder() {
       @Override
       public void configure() throws Exception {
       EndpointUriFactory factory = getContext().adapt(ExtendedCamelContext.class).getEndpointUriFactory("google-bigquery-sql");
       Map<String, Object> config = Map.of(
       "projectId", "test", 
       "query", "insert into test.test values (1,1)"
       );
       String uri = factory.buildUri("google-bigquery-sql", config, false);
       System.out.println("uri = " + uri);
       from("direct:start").to(uri);
       }
      });
      main.run();
       
      

       

      The output of this jbang jsh file will be

      uri = google-biginsert into test.test values (1,1)-sql:test:insert into test.test values (1,1)

      which is wrong, the google-bigquery-sql is now google-big<query path param>-sql:..

      I think for google big query we need to rename the query path param, but maybe the generation and substitution needs to be checked again

       

       

      Attachments

        Activity

          People

            acosentino Andrea Cosentino
            acosentino Andrea Cosentino
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: