You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/07/29 16:16:11 UTC

[camel] branch main created (now 035ce73)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git.


      at 035ce73  Regen for commit 5003dbb1180f0545f79ea0b93d6605d5ee334f51 (#5887)

This branch includes the following new commits:

     new 2735748  Regen for commit af2126962f2024611b76a5fedc2ae2a17bf764bc
     new 0114fc9  camel-jbang: adjusted to automatically name the generated Kamelet (#5884)
     new 035ce73  Regen for commit 5003dbb1180f0545f79ea0b93d6605d5ee334f51 (#5887)

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[camel] 01/03: Regen for commit af2126962f2024611b76a5fedc2ae2a17bf764bc

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2735748d603494492e46c85a0956afc0ffef49fa
Author: davsclaus <da...@users.noreply.github.com>
AuthorDate: Thu Jul 29 15:30:01 2021 +0000

    Regen for commit af2126962f2024611b76a5fedc2ae2a17bf764bc
    
    Signed-off-by: GitHub <no...@github.com>
---
 .../catalog/models/serviceCallConfiguration.json   |   2 +-
 .../apache/camel/catalog/schemas/camel-spring.xsd  | 172 ++++++++++++++++++++-
 2 files changed, 172 insertions(+), 2 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/serviceCallConfiguration.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/serviceCallConfiguration.json
index 9cb7cbb..7d5d18b 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/serviceCallConfiguration.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/serviceCallConfiguration.json
@@ -12,7 +12,7 @@
   },
   "properties": {
     "expression": { "kind": "element", "displayName": "Expression", "required": false, "type": "object", "javaType": "org.apache.camel.model.cloud.ServiceCallExpressionConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Configures the Expression using the given configuration." },
-    "uri": { "kind": "attribute", "displayName": "Uri", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The uri of the endpoint to send to. The uri can be dynamic computed using the org.apache.camel.language.simple.SimpleLanguage expression." },
+    "uri": { "kind": "attribute", "displayName": "Uri", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The uri of the endpoint to send to. The uri can be dynamic computed using the simple language expression." },
     "component": { "kind": "attribute", "displayName": "Component", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "http", "description": "The component to use." },
     "pattern": { "kind": "attribute", "displayName": "Pattern", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOptionalOut", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the optional ExchangePattern used to invoke this endpoint" },
     "serviceDiscoveryRef": { "kind": "attribute", "displayName": "Service Discovery Ref", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a reference to a custom ServiceDiscovery to use." },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
index 9110cba..129cdd7 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://camel.apache.org/schema/spring" elementFormDefault="qualified" targetNamespace="http://camel.apache.org/schema/spring" version="1.0">
 
+  <xs:import schemaLocation="schema2.xsd"/>
+
   <xs:element name="aggregate" type="tns:aggregateDefinition">
     <xs:annotation>
       <xs:documentation xml:lang="en"><![CDATA[
@@ -12443,6 +12445,14 @@ properties are define in com.netflix.client.config.CommonClientConfigKey.
     </xs:complexContent>
   </xs:complexType>
 
+  <xs:complexType name="blacklistServiceCallServiceFilterConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
   <xs:complexType name="cachingServiceCallServiceDiscoveryConfiguration">
     <xs:complexContent>
       <xs:extension base="tns:serviceCallServiceDiscoveryConfiguration">
@@ -12814,6 +12824,22 @@ the format: servicehost:port,servicehost2:port,servicehost3:port.
     </xs:complexContent>
   </xs:complexType>
 
+  <xs:complexType name="cachingServiceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="combinedServiceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
   <xs:complexType name="combinedServiceCallServiceFilterConfiguration">
     <xs:complexContent>
       <xs:extension base="tns:serviceCallServiceFilterConfiguration">
@@ -12860,6 +12886,30 @@ Reference of a ServiceFilter.
     </xs:complexContent>
   </xs:complexType>
 
+  <xs:complexType name="combinedServiceCallServiceFilterConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="consulServiceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="customServiceCallServiceFilterConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
   <xs:complexType name="defaultServiceCallServiceLoadBalancerConfiguration">
     <xs:complexContent>
       <xs:extension base="tns:serviceCallServiceLoadBalancerConfiguration">
@@ -12876,6 +12926,54 @@ Reference of a ServiceFilter.
     </xs:complexContent>
   </xs:complexType>
 
+  <xs:complexType name="defaultServiceCallServiceLoadBalancerConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="dnsServiceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="etcdServiceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="healthyServiceCallServiceFilterConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="kubernetesServiceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="passThroughServiceCallServiceFilterConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
   <xs:complexType name="ribbonServiceCallServiceLoadBalancerConfiguration">
     <xs:complexContent>
       <xs:extension base="tns:serviceCallServiceLoadBalancerConfiguration">
@@ -12912,6 +13010,22 @@ Sets the Ribbon client name.
     </xs:complexContent>
   </xs:complexType>
 
+  <xs:complexType name="ribbonServiceCallServiceLoadBalancerConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="serviceCallConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
   <xs:complexType name="serviceCallConfigurationDefinition">
     <xs:complexContent>
       <xs:extension base="tns:identifiedType">
@@ -12949,7 +13063,7 @@ Configures the Expression using the given configuration.
           <xs:annotation>
             <xs:documentation xml:lang="en"><![CDATA[
 The uri of the endpoint to send to. The uri can be dynamic computed using the
-org.apache.camel.language.simple.SimpleLanguage expression.
+simple language expression.
             ]]></xs:documentation>
           </xs:annotation>
         </xs:attribute>
@@ -13232,6 +13346,14 @@ Set a reference to a custom Expression to use.
     <xs:sequence/>
   </xs:complexType>
 
+  <xs:complexType name="serviceCallExpressionConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
   <xs:complexType name="serviceCallServiceChooserConfiguration">
     <xs:complexContent>
       <xs:extension base="tns:serviceCallConfiguration">
@@ -13240,6 +13362,54 @@ Set a reference to a custom Expression to use.
     </xs:complexContent>
   </xs:complexType>
 
+  <xs:complexType name="serviceCallServiceChooserConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="serviceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="serviceCallServiceFilterConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="serviceCallServiceLoadBalancerConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="staticServiceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="zooKeeperServiceCallServiceDiscoveryConfigurationConfigurer">
+    <xs:complexContent>
+      <xs:extension base="propertyConfigurerSupport">
+        <xs:sequence/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
   <xs:complexType name="dataFormatsDefinition">
     <xs:sequence>
       <xs:choice maxOccurs="unbounded" minOccurs="0">

[camel] 02/03: camel-jbang: adjusted to automatically name the generated Kamelet (#5884)

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0114fc970c2115c494790c3c0913f83dc8ef6b53
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Thu Jul 29 18:03:57 2021 +0200

    camel-jbang: adjusted to automatically name the generated Kamelet (#5884)
---
 .../modules/ROOT/pages/camel-jbang.adoc            |  2 +-
 .../core/templates/VelocityTemplateParser.java     | 29 ++++++++++++++--------
 .../camel-jbang-main/dist/CamelJBang.java          | 10 +++++---
 .../src/main/jbang/main/CamelJBang.java            | 10 +++++---
 4 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
index 3e6a23d..ff57168 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
@@ -90,7 +90,7 @@ After you have filled the values, you can generate the Kamelet using:
 CamelJBang init kamelet --properties-path work/init-template.properties
 ```
 
-Running this command will create a file named `init-template.kamelet.yaml` in the `work` directory.
+Running this command will create a new file in the `work` directory. The name of the generated file is determined by the `kameletMetadataName` property in the properties file. As such, parsing the default properties file would generate a file named `my-sample-sink.kamelet.yaml` in the directory.
 
 After the file is generated, it may still need to require final adjustments, such as correctly setting the name, the icon and other requirements for official Kamelets. Please consult the Kamelet development documentation for updated details.
 
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/templates/VelocityTemplateParser.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/templates/VelocityTemplateParser.java
index d6004b9..e0cdf33 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/templates/VelocityTemplateParser.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/templates/VelocityTemplateParser.java
@@ -25,6 +25,7 @@ import java.util.Properties;
 
 import org.apache.camel.CamelException;
 import org.apache.camel.dsl.jbang.core.api.TemplateParser;
+import org.apache.camel.dsl.jbang.core.common.exceptions.ResourceAlreadyExists;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
@@ -35,15 +36,18 @@ import org.apache.velocity.exception.ResourceNotFoundException;
 import org.apache.velocity.runtime.RuntimeConstants;
 
 public class VelocityTemplateParser implements TemplateParser {
-    private final File propertiesFile;
+    private final Properties properties = new Properties();
 
-    public VelocityTemplateParser(File templateDir, String propertiesFile) {
+    public VelocityTemplateParser(File templateDir, String propertiesFile) throws IOException {
         this(templateDir, new File(propertiesFile));
     }
 
-    public VelocityTemplateParser(File templateDir, File propertiesFile) {
-        this.propertiesFile = propertiesFile;
+    public VelocityTemplateParser(File templateDir, File propertiesFile) throws IOException {
         initializeTemplateEngine(templateDir);
+
+        try (FileReader propertiesReader = new FileReader(propertiesFile)) {
+            properties.load(propertiesReader);
+        }
     }
 
     private void initializeTemplateEngine(File templateDir) {
@@ -90,12 +94,6 @@ public class VelocityTemplateParser implements TemplateParser {
     }
 
     private void loadTemplateProperties(VelocityContext context) throws IOException {
-        Properties properties = new Properties();
-
-        try (FileReader propertiesReader = new FileReader(propertiesFile)) {
-            properties.load(propertiesReader);
-        }
-
         properties.forEach((k, v) -> context.put(k.toString(), v));
 
         overridePropertyList(context, properties, "kameletProperties");
@@ -104,4 +102,15 @@ public class VelocityTemplateParser implements TemplateParser {
         overridePropertyList(context, properties, "fromParameters");
         overridePropertyList(context, properties, "toParameters");
     }
+
+    public File getOutputFile(File outputDir) throws ResourceAlreadyExists {
+        String outputFileName = properties.getProperty("kameletMetadataName") + ".kamelet.yaml";
+
+        File outputFile = new File(outputDir, outputFileName);
+        if (outputFile.exists()) {
+            throw new ResourceAlreadyExists(outputFile);
+        }
+
+        return outputFile;
+    }
 }
diff --git a/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java b/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java
index 4c048ad..049a0f1 100755
--- a/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java
+++ b/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java
@@ -480,15 +480,19 @@ class InitKamelet extends AbstractInitKamelet implements Callable<Integer> {
             System.err.println(e.getMessage());
             return 1;
         }
-
         localTemplateFile.deleteOnExit();
 
         VelocityTemplateParser templateParser = new VelocityTemplateParser(
                 localTemplateFile.getParentFile(),
                 processOptions.propertiesPath);
 
-        String outputFileName = localTemplateFile.getName().replace(".vm", "");
-        File outputFile = new File(localTemplateFile.getParentFile(), outputFileName);
+        File outputFile;
+        try {
+            outputFile = templateParser.getOutputFile(workDirectory);
+        } catch (ResourceAlreadyExists e) {
+            System.err.println(e.getMessage());
+            return 1;
+        }
 
         try (FileWriter fw = new FileWriter(outputFile)) {
             templateParser.parse(localTemplateFile.getName(), fw);
diff --git a/dsl/camel-jbang/camel-jbang-main/src/main/jbang/main/CamelJBang.java b/dsl/camel-jbang/camel-jbang-main/src/main/jbang/main/CamelJBang.java
index 09dbe3e..06bdd6d 100755
--- a/dsl/camel-jbang/camel-jbang-main/src/main/jbang/main/CamelJBang.java
+++ b/dsl/camel-jbang/camel-jbang-main/src/main/jbang/main/CamelJBang.java
@@ -480,15 +480,19 @@ class InitKamelet extends AbstractInitKamelet implements Callable<Integer> {
             System.err.println(e.getMessage());
             return 1;
         }
-
         localTemplateFile.deleteOnExit();
 
         VelocityTemplateParser templateParser = new VelocityTemplateParser(
                 localTemplateFile.getParentFile(),
                 processOptions.propertiesPath);
 
-        String outputFileName = localTemplateFile.getName().replace(".vm", "");
-        File outputFile = new File(localTemplateFile.getParentFile(), outputFileName);
+        File outputFile;
+        try {
+            outputFile = templateParser.getOutputFile(workDirectory);
+        } catch (ResourceAlreadyExists e) {
+            System.err.println(e.getMessage());
+            return 1;
+        }
 
         try (FileWriter fw = new FileWriter(outputFile)) {
             templateParser.parse(localTemplateFile.getName(), fw);

[camel] 03/03: Regen for commit 5003dbb1180f0545f79ea0b93d6605d5ee334f51 (#5887)

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 035ce73b879c353df1371ea28ba38eb82648b200
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Thu Jul 29 18:04:10 2021 +0200

    Regen for commit 5003dbb1180f0545f79ea0b93d6605d5ee334f51 (#5887)
    
    Signed-off-by: GitHub <no...@github.com>
    
    Co-authored-by: davsclaus <da...@users.noreply.github.com>
---
 .../zookeeper/cloud/ZooKeeperServiceDiscoveryFactoryConfigurer.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/components/camel-zookeeper/src/generated/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceDiscoveryFactoryConfigurer.java b/components/camel-zookeeper/src/generated/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceDiscoveryFactoryConfigurer.java
index 6202e1d..a06cb94 100644
--- a/components/camel-zookeeper/src/generated/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceDiscoveryFactoryConfigurer.java
+++ b/components/camel-zookeeper/src/generated/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceDiscoveryFactoryConfigurer.java
@@ -40,7 +40,7 @@ public class ZooKeeperServiceDiscoveryFactoryConfigurer extends org.apache.camel
         case "namespace":
         case "Namespace": target.setNamespace(property(camelContext, java.lang.String.class, value)); return true;
         case "nodes":
-        case "Nodes": target.setNodes(property(camelContext, java.util.List.class, value)); return true;
+        case "Nodes": target.setNodes(property(camelContext, java.lang.String.class, value)); return true;
         case "reconnectbasesleeptime":
         case "ReconnectBaseSleepTime": target.setReconnectBaseSleepTime(property(camelContext, long.class, value)); return true;
         case "reconnectbasesleeptimeunit":
@@ -83,7 +83,7 @@ public class ZooKeeperServiceDiscoveryFactoryConfigurer extends org.apache.camel
         case "namespace":
         case "Namespace": return java.lang.String.class;
         case "nodes":
-        case "Nodes": return java.util.List.class;
+        case "Nodes": return java.lang.String.class;
         case "reconnectbasesleeptime":
         case "ReconnectBaseSleepTime": return long.class;
         case "reconnectbasesleeptimeunit":
@@ -153,8 +153,6 @@ public class ZooKeeperServiceDiscoveryFactoryConfigurer extends org.apache.camel
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "authinfolist":
         case "AuthInfoList": return org.apache.curator.framework.AuthInfo.class;
-        case "nodes":
-        case "Nodes": return java.lang.String.class;
         default: return null;
         }
     }