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

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

commit 0330cc1419854109d3927365e24ad3c5044299a0
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Dec 18 10:41:09 2025 +0100

    CAMEL-22431: camel-once - A component for development to trigger only once
---
 .../org/apache/camel/catalog/components/once.json  |   3 +-
 .../component/ComponentsBuilderFactory.java        |  13 ++
 .../component/dsl/OnceComponentBuilderFactory.java | 160 +++++++++++++++++++++
 3 files changed, 175 insertions(+), 1 deletion(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/once.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/once.json
index 3dbbeeaae5fa..881706bc8d62 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/once.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/once.json
@@ -26,7 +26,8 @@
   "componentProperties": {
     "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": 
"Bridge Error Handler", "group": "consumer", "label": "consumer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": 
"Allows for bridging the consumer to the Camel routing Error Handler, which 
mean any exceptions (if possible) occurred while the Camel consumer is trying 
to pickup incoming messages, or the like [...]
     "autowiredEnabled": { "index": 1, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching t [...]
-    "delay": { "index": 2, "kind": "property", "displayName": "Delay", 
"group": "advanced", "label": "advanced", "required": false, "type": "integer", 
"javaType": "long", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1000, "description": "The number of milliseconds to wait before 
triggering. The default value is 1000." }
+    "delay": { "index": 2, "kind": "property", "displayName": "Delay", 
"group": "advanced", "label": "advanced", "required": false, "type": "integer", 
"javaType": "long", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1000, "description": "The number of milliseconds to wait before 
triggering. The default value is 1000." },
+    "languages": { "index": 3, "kind": "property", "displayName": "Languages", 
"group": "advanced", "label": "advanced", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "autowired": false, "secret": 
false, "defaultValue": true, "description": "Whether Camel languages are 
supported such as simple,groovy." }
   },
   "properties": {
     "name": { "index": 0, "kind": "path", "displayName": "Name", "group": 
"consumer", "label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The logical name" },
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index 09665a210855..9847ffd6fb9e 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -3553,6 +3553,19 @@ public interface ComponentsBuilderFactory {
     static Olingo4ComponentBuilderFactory.Olingo4ComponentBuilder olingo4() {
         return Olingo4ComponentBuilderFactory.olingo4();
     }
+    /**
+     * Once (camel-once)
+     * Camel Once component
+     * 
+     * Category: core,scheduling
+     * Since: 4.170
+     * Maven coordinates: org.apache.camel:camel-once
+     * 
+     * @return the dsl builder
+     */
+    static OnceComponentBuilderFactory.OnceComponentBuilder once() {
+        return OnceComponentBuilderFactory.once();
+    }
     /**
      * OpenSearch (camel-opensearch)
      * Send requests to OpenSearch via Java Client API.
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/OnceComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/OnceComponentBuilderFactory.java
new file mode 100644
index 000000000000..7de0e63c89b5
--- /dev/null
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/OnceComponentBuilderFactory.java
@@ -0,0 +1,160 @@
+/* Generated by camel build tools - do NOT edit this file! */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.builder.component.dsl;
+
+import javax.annotation.processing.Generated;
+import org.apache.camel.Component;
+import org.apache.camel.builder.component.AbstractComponentBuilder;
+import org.apache.camel.builder.component.ComponentBuilder;
+import org.apache.camel.component.once.OnceComponent;
+
+/**
+ * Camel Once component
+ * 
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
+public interface OnceComponentBuilderFactory {
+
+    /**
+     * Once (camel-once)
+     * Camel Once component
+     * 
+     * Category: core,scheduling
+     * Since: 4.170
+     * Maven coordinates: org.apache.camel:camel-once
+     * 
+     * @return the dsl builder
+     */
+    static OnceComponentBuilder once() {
+        return new OnceComponentBuilderImpl();
+    }
+
+    /**
+     * Builder for the Once component.
+     */
+    interface OnceComponentBuilder extends ComponentBuilder<OnceComponent> {
+    
+        
+        /**
+         * Allows for bridging the consumer to the Camel routing Error Handler,
+         * which mean any exceptions (if possible) occurred while the Camel
+         * consumer is trying to pickup incoming messages, or the likes, will
+         * now be processed as a message and handled by the routing Error
+         * Handler. Important: This is only possible if the 3rd party component
+         * allows Camel to be alerted if an exception was thrown. Some
+         * components handle this internally only, and therefore
+         * bridgeErrorHandler is not possible. In other situations we may
+         * improve the Camel component to hook into the 3rd party component and
+         * make this possible for future releases. By default the consumer will
+         * use the org.apache.camel.spi.ExceptionHandler to deal with
+         * exceptions, that will be logged at WARN or ERROR level and ignored.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: consumer
+         * 
+         * @param bridgeErrorHandler the value to set
+         * @return the dsl builder
+         */
+        default OnceComponentBuilder bridgeErrorHandler(boolean 
bridgeErrorHandler) {
+            doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+            return this;
+        }
+    
+        
+        /**
+         * Whether autowiring is enabled. This is used for automatic autowiring
+         * options (the option must be marked as autowired) by looking up in 
the
+         * registry to find if there is a single instance of matching type,
+         * which then gets configured on the component. This can be used for
+         * automatic configuring JDBC data sources, JMS connection factories,
+         * AWS Clients, etc.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: true
+         * Group: advanced
+         * 
+         * @param autowiredEnabled the value to set
+         * @return the dsl builder
+         */
+        default OnceComponentBuilder autowiredEnabled(boolean 
autowiredEnabled) {
+            doSetProperty("autowiredEnabled", autowiredEnabled);
+            return this;
+        }
+    
+        
+        /**
+         * The number of milliseconds to wait before triggering. The default
+         * value is 1000.
+         * 
+         * The option is a: &lt;code&gt;long&lt;/code&gt; type.
+         * 
+         * Default: 1000
+         * Group: advanced
+         * 
+         * @param delay the value to set
+         * @return the dsl builder
+         */
+        default OnceComponentBuilder delay(long delay) {
+            doSetProperty("delay", delay);
+            return this;
+        }
+    
+        
+        /**
+         * Whether Camel languages are supported such as simple,groovy.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: true
+         * Group: advanced
+         * 
+         * @param languages the value to set
+         * @return the dsl builder
+         */
+        default OnceComponentBuilder languages(boolean languages) {
+            doSetProperty("languages", languages);
+            return this;
+        }
+    }
+
+    class OnceComponentBuilderImpl
+            extends AbstractComponentBuilder<OnceComponent>
+            implements OnceComponentBuilder {
+        @Override
+        protected OnceComponent buildConcreteComponent() {
+            return new OnceComponent();
+        }
+        @Override
+        protected boolean setPropertyOnComponent(
+                Component component,
+                String name,
+                Object value) {
+            switch (name) {
+            case "bridgeErrorHandler": ((OnceComponent) 
component).setBridgeErrorHandler((boolean) value); return true;
+            case "autowiredEnabled": ((OnceComponent) 
component).setAutowiredEnabled((boolean) value); return true;
+            case "delay": ((OnceComponent) component).setDelay((long) value); 
return true;
+            case "languages": ((OnceComponent) 
component).setLanguages((boolean) value); return true;
+            default: return false;
+            }
+        }
+    }
+}
\ No newline at end of file

Reply via email to