This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 506561d CAMEL-16602: Move camel-kamelet-reify to main camel project
from camel-k-runtime.
506561d is described below
commit 506561d54ce1a57b61788fff6b426041782dde2d
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue May 11 12:36:12 2021 +0200
CAMEL-16602: Move camel-kamelet-reify to main camel project from
camel-k-runtime.
---
bom/camel-bom/pom.xml | 5 +
.../org/apache/camel/catalog/components.properties | 1 +
.../camel/catalog/components/kamelet-reify.json | 36 +++
.../org/apache/camel/catalog/docs.properties | 1 +
.../catalog/docs/kamelet-reify-component.adoc | 82 ++++++
components/camel-kamelet-reify/pom.xml | 110 +++++++
.../KameletReifyComponentConfigurer.java | 61 ++++
.../KameletReifyEndpointConfigurer.java | 67 +++++
.../KameletReifyEndpointUriFactory.java | 65 +++++
.../services/org/apache/camel/component.properties | 7 +
.../org/apache/camel/component/kamelet-reify | 2 +
.../camel/configurer/kamelet-reify-component | 2 +
.../apache/camel/configurer/kamelet-reify-endpoint | 2 +
.../apache/camel/urifactory/kamelet-reify-endpoint | 2 +
.../component/kameletreify/kamelet-reify.json | 36 +++
.../src/main/docs/kamelet-reify-component.adoc | 82 ++++++
.../camel/component/kameletreify/KameletReify.java | 45 +++
.../kameletreify/KameletReifyComponent.java | 91 ++++++
.../kameletreify/KameletReifyEndpoint.java | 162 +++++++++++
.../kameletreify/KameletReifyBasicTest.java | 116 ++++++++
.../src/test/resources/log4j2-test.xml | 42 +++
components/pom.xml | 1 +
core/camel-allcomponents/pom.xml | 4 +
.../component/ComponentsBuilderFactory.java | 13 +
.../dsl/KameletReifyComponentBuilderFactory.java | 144 +++++++++
.../src/generated/resources/metadata.json | 22 ++
.../builder/endpoint/EndpointBuilderFactory.java | 1 +
.../camel/builder/endpoint/EndpointBuilders.java | 1 +
.../builder/endpoint/StaticEndpointBuilders.java | 43 +++
.../dsl/KameletReifyEndpointBuilderFactory.java | 321 +++++++++++++++++++++
.../org/apache/camel/main/components.properties | 1 +
docs/components/modules/ROOT/nav.adoc | 1 +
.../ROOT/pages/kamelet-reify-component.adoc | 84 ++++++
parent/pom.xml | 5 +
34 files changed, 1658 insertions(+)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 20310fe..b29ba48 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -1159,6 +1159,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-kamelet-reify</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-kotlin-dsl</artifactId>
<version>${project.version}</version>
</dependency>
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
index 880faef..a1e8bcb 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
@@ -186,6 +186,7 @@ jsonata
jt400
kafka
kamelet
+kamelet-reify
kubernetes-config-maps
kubernetes-custom-resources
kubernetes-deployments
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kamelet-reify.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kamelet-reify.json
new file mode 100644
index 0000000..2f12730
--- /dev/null
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kamelet-reify.json
@@ -0,0 +1,36 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "kamelet-reify",
+ "title": "Kamelet Reify",
+ "description": "To call Kamelets (indirectly)",
+ "deprecated": false,
+ "firstVersion": "3.6.0",
+ "label": "core",
+ "javaType":
"org.apache.camel.component.kameletreify.KameletReifyComponent",
+ "supportLevel": "Stable",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-kamelet-reify",
+ "version": "3.10.0-SNAPSHOT",
+ "scheme": "kamelet-reify",
+ "extendsScheme": "",
+ "syntax": "kamelet-reify:delegateUri",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": false,
+ "lenientProperties": true
+ },
+ "componentProperties": {
+ "bridgeErrorHandler": { "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 occurred
while the consumer is trying to pickup incoming messages, or the likes, will
now be processed as a me [...]
+ "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start
Producer", "group": "producer", "label": "producer", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "description": "Whether the producer
should be started lazy (on the first message). By starting lazy you can use
this to allow CamelContext and routes to startup in situations where a producer
may otherwise fail during star [...]
+ "autowiredEnabled": { "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 type, which t [...]
+ },
+ "properties": {
+ "delegateUri": { "kind": "path", "displayName": "Delegate Uri", "group":
"common", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired":
false, "secret": false, "description": "The delegated uri" },
+ "bridgeErrorHandler": { "kind": "parameter", "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 occurred
while the consumer is trying to pickup incoming messages, or the likes, will
now be processed as a m [...]
+ "exceptionHandler": { "kind": "parameter", "displayName": "Exception
Handler", "group": "consumer (advanced)", "label": "consumer,advanced",
"required": false, "type": "object", "javaType":
"org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.",
"deprecated": false, "autowired": false, "secret": false, "description": "To
let the consumer use a custom ExceptionHandler. Notice if the option
bridgeErrorHandler is enabled then this option is not in use. By default the
con [...]
+ "exchangePattern": { "kind": "parameter", "displayName": "Exchange
Pattern", "group": "consumer (advanced)", "label": "consumer,advanced",
"required": false, "type": "object", "javaType":
"org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut",
"InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false,
"description": "Sets the exchange pattern when the consumer creates an
exchange." },
+ "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start
Producer", "group": "producer", "label": "producer", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "description": "Whether the producer
should be started lazy (on the first message). By starting lazy you can use
this to allow CamelContext and routes to startup in situations where a producer
may otherwise fail during sta [...]
+ }
+}
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
index 4caf0c7..f3dcaac 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
@@ -270,6 +270,7 @@ jta
kafka-component
kamelet-component
kamelet-eip
+kamelet-reify-component
kubernetes-config-maps-component
kubernetes-custom-resources-component
kubernetes-deployments-component
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kamelet-reify-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kamelet-reify-component.adoc
new file mode 100644
index 0000000..6355228
--- /dev/null
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kamelet-reify-component.adoc
@@ -0,0 +1,82 @@
+[[kamelet-reify-component]]
+= Kamelet Reify Component
+:docTitle: Kamelet Reify
+:artifactId: camel-kamelet-reify
+:description: To call Kamelets (indirectly)
+:since: 3.6
+:supportLevel: Stable
+:component-header: Both producer and consumer are supported
+:core:
+include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/kamelet-reify.adoc[opts=optional]
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The Kamelet Reify Component provides support for calling endpoints that are
isolatated (a.k.a. _local mode_).
+This is needed by Kamelets to ensure they are isolated and independent.
+
+IMPORTANT: The *camel-kamelet-reify* component is becoming obsolete, as
Kamelets (route templates) has support for local beans,
+which is the recommended practice to use for building Kamelets that are
isolated and independent.
+Therefore this component is expected to become deprecated in the near future
and removed later.
+
+== Options
+
+
+
+// component options: START
+The Kamelet Reify component supports 3 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy
(on the first message). By starting lazy you can use this to allow CamelContext
and routes to startup in situations where a producer may otherwise fail during
starting and cause the route to fail being started. By deferring this startup
to be lazy then the startup failure can be handled during routing messages via
Camel's routing error handlers. Beware that when the first message is processed
then creating and [...]
+| *autowiredEnabled* (advanced) | 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. | true | boolean
+|===
+// component options: END
+
+
+
+
+// endpoint options: START
+The Kamelet Reify endpoint is configured using URI syntax:
+
+----
+kamelet-reify:delegateUri
+----
+
+with the following path and query parameters:
+
+=== Path Parameters (1 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *delegateUri* | *Required* The delegated uri | | String
+|===
+
+
+=== Query Parameters (4 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
+| *exceptionHandler* (consumer) | To let the consumer use a custom
ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this
option is not in use. By default the consumer will deal with exceptions, that
will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
+| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer
creates an exchange. There are 3 enums and the value can be one of: InOnly,
InOut, InOptionalOut | | ExchangePattern
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy
(on the first message). By starting lazy you can use this to allow CamelContext
and routes to startup in situations where a producer may otherwise fail during
starting and cause the route to fail being started. By deferring this startup
to be lazy then the startup failure can be handled during routing messages via
Camel's routing error handlers. Beware that when the first message is processed
then creating and [...]
+|===
+// endpoint options: END
+
+[NOTE]
+====
+The *kamelet-reify* endpoint is *lenient*, which means that the endpoint
accepts additional parameters that are passed to the route template engine and
consumed upon route materialization.
+====
+
+
+//include::{page-component-version}@camel-spring-boot::page$kamelet-reify-starter.adoc[]
diff --git a/components/camel-kamelet-reify/pom.xml
b/components/camel-kamelet-reify/pom.xml
new file mode 100644
index 0000000..26e59f8
--- /dev/null
+++ b/components/camel-kamelet-reify/pom.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>components</artifactId>
+ <version>3.10.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-kamelet-reify</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Camel :: Kamelet Reifiy</name>
+ <description>To call Kamelets (indirectly)</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core-reifier</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core-model</artifactId>
+ </dependency>
+
+ <!-- TESTS -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-groovy</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-joor</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-timer</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-log</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-direct</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-testcontainers-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-http</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-activemq</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git
a/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyComponentConfigurer.java
b/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyComponentConfigurer.java
new file mode 100644
index 0000000..044d16e
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyComponentConfigurer.java
@@ -0,0 +1,61 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.kameletreify;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class KameletReifyComponentConfigurer extends PropertyConfigurerSupport
implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String
name, Object value, boolean ignoreCase) {
+ KameletReifyComponent target = (KameletReifyComponent) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "autowiredenabled":
+ case "autowiredEnabled":
target.setAutowiredEnabled(property(camelContext, boolean.class, value));
return true;
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler":
target.setBridgeErrorHandler(property(camelContext, boolean.class, value));
return true;
+ case "lazystartproducer":
+ case "lazyStartProducer":
target.setLazyStartProducer(property(camelContext, boolean.class, value));
return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "autowiredenabled":
+ case "autowiredEnabled": return boolean.class;
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return boolean.class;
+ case "lazystartproducer":
+ case "lazyStartProducer": return boolean.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ KameletReifyComponent target = (KameletReifyComponent) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "autowiredenabled":
+ case "autowiredEnabled": return target.isAutowiredEnabled();
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return target.isBridgeErrorHandler();
+ case "lazystartproducer":
+ case "lazyStartProducer": return target.isLazyStartProducer();
+ default: return null;
+ }
+ }
+}
+
diff --git
a/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyEndpointConfigurer.java
b/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyEndpointConfigurer.java
new file mode 100644
index 0000000..c949e1e
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyEndpointConfigurer.java
@@ -0,0 +1,67 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.kameletreify;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class KameletReifyEndpointConfigurer extends PropertyConfigurerSupport
implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String
name, Object value, boolean ignoreCase) {
+ KameletReifyEndpoint target = (KameletReifyEndpoint) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler":
target.setBridgeErrorHandler(property(camelContext, boolean.class, value));
return true;
+ case "exceptionhandler":
+ case "exceptionHandler":
target.setExceptionHandler(property(camelContext,
org.apache.camel.spi.ExceptionHandler.class, value)); return true;
+ case "exchangepattern":
+ case "exchangePattern":
target.setExchangePattern(property(camelContext,
org.apache.camel.ExchangePattern.class, value)); return true;
+ case "lazystartproducer":
+ case "lazyStartProducer":
target.setLazyStartProducer(property(camelContext, boolean.class, value));
return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return boolean.class;
+ case "exceptionhandler":
+ case "exceptionHandler": return
org.apache.camel.spi.ExceptionHandler.class;
+ case "exchangepattern":
+ case "exchangePattern": return org.apache.camel.ExchangePattern.class;
+ case "lazystartproducer":
+ case "lazyStartProducer": return boolean.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ KameletReifyEndpoint target = (KameletReifyEndpoint) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return target.isBridgeErrorHandler();
+ case "exceptionhandler":
+ case "exceptionHandler": return target.getExceptionHandler();
+ case "exchangepattern":
+ case "exchangePattern": return target.getExchangePattern();
+ case "lazystartproducer":
+ case "lazyStartProducer": return target.isLazyStartProducer();
+ default: return null;
+ }
+ }
+}
+
diff --git
a/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyEndpointUriFactory.java
b/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyEndpointUriFactory.java
new file mode 100644
index 0000000..3453bb8
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/java/org/apache/camel/component/kameletreify/KameletReifyEndpointUriFactory.java
@@ -0,0 +1,65 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.kameletreify;
+
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.spi.EndpointUriFactory;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+public class KameletReifyEndpointUriFactory extends
org.apache.camel.support.component.EndpointUriFactorySupport implements
EndpointUriFactory {
+
+ private static final String BASE = ":delegateUri";
+
+ private static final Set<String> PROPERTY_NAMES;
+ private static final Set<String> SECRET_PROPERTY_NAMES;
+ static {
+ Set<String> props = new HashSet<>(5);
+ props.add("lazyStartProducer");
+ props.add("bridgeErrorHandler");
+ props.add("exchangePattern");
+ props.add("delegateUri");
+ props.add("exceptionHandler");
+ PROPERTY_NAMES = Collections.unmodifiableSet(props);
+ SECRET_PROPERTY_NAMES = Collections.emptySet();
+ }
+
+ @Override
+ public boolean isEnabled(String scheme) {
+ return "kamelet-reify".equals(scheme);
+ }
+
+ @Override
+ public String buildUri(String scheme, Map<String, Object> properties,
boolean encode) throws URISyntaxException {
+ String syntax = scheme + BASE;
+ String uri = syntax;
+
+ Map<String, Object> copy = new HashMap<>(properties);
+
+ uri = buildPathParameter(syntax, uri, "delegateUri", null, true, copy);
+ uri = buildQueryParameters(uri, copy, encode);
+ return uri;
+ }
+
+ @Override
+ public Set<String> propertyNames() {
+ return PROPERTY_NAMES;
+ }
+
+ @Override
+ public Set<String> secretPropertyNames() {
+ return SECRET_PROPERTY_NAMES;
+ }
+
+ @Override
+ public boolean isLenientProperties() {
+ return true;
+ }
+}
+
diff --git
a/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/component.properties
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/component.properties
new file mode 100644
index 0000000..5c5fbba
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/component.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+components=kamelet-reify
+groupId=org.apache.camel
+artifactId=camel-kamelet-reify
+version=3.10.0-SNAPSHOT
+projectName=Camel :: Kamelet Reifiy
+projectDescription=To call Kamelets (indirectly)
diff --git
a/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/component/kamelet-reify
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/component/kamelet-reify
new file mode 100644
index 0000000..d3b0633
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/component/kamelet-reify
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.kameletreify.KameletReifyComponent
diff --git
a/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/configurer/kamelet-reify-component
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/configurer/kamelet-reify-component
new file mode 100644
index 0000000..73dc8e4
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/configurer/kamelet-reify-component
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.kameletreify.KameletReifyComponentConfigurer
diff --git
a/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/configurer/kamelet-reify-endpoint
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/configurer/kamelet-reify-endpoint
new file mode 100644
index 0000000..babbb50
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/configurer/kamelet-reify-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.kameletreify.KameletReifyEndpointConfigurer
diff --git
a/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/urifactory/kamelet-reify-endpoint
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/urifactory/kamelet-reify-endpoint
new file mode 100644
index 0000000..47bf727
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/resources/META-INF/services/org/apache/camel/urifactory/kamelet-reify-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.kameletreify.KameletReifyEndpointUriFactory
diff --git
a/components/camel-kamelet-reify/src/generated/resources/org/apache/camel/component/kameletreify/kamelet-reify.json
b/components/camel-kamelet-reify/src/generated/resources/org/apache/camel/component/kameletreify/kamelet-reify.json
new file mode 100644
index 0000000..2f12730
--- /dev/null
+++
b/components/camel-kamelet-reify/src/generated/resources/org/apache/camel/component/kameletreify/kamelet-reify.json
@@ -0,0 +1,36 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "kamelet-reify",
+ "title": "Kamelet Reify",
+ "description": "To call Kamelets (indirectly)",
+ "deprecated": false,
+ "firstVersion": "3.6.0",
+ "label": "core",
+ "javaType":
"org.apache.camel.component.kameletreify.KameletReifyComponent",
+ "supportLevel": "Stable",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-kamelet-reify",
+ "version": "3.10.0-SNAPSHOT",
+ "scheme": "kamelet-reify",
+ "extendsScheme": "",
+ "syntax": "kamelet-reify:delegateUri",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": false,
+ "lenientProperties": true
+ },
+ "componentProperties": {
+ "bridgeErrorHandler": { "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 occurred
while the consumer is trying to pickup incoming messages, or the likes, will
now be processed as a me [...]
+ "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start
Producer", "group": "producer", "label": "producer", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "description": "Whether the producer
should be started lazy (on the first message). By starting lazy you can use
this to allow CamelContext and routes to startup in situations where a producer
may otherwise fail during star [...]
+ "autowiredEnabled": { "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 type, which t [...]
+ },
+ "properties": {
+ "delegateUri": { "kind": "path", "displayName": "Delegate Uri", "group":
"common", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired":
false, "secret": false, "description": "The delegated uri" },
+ "bridgeErrorHandler": { "kind": "parameter", "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 occurred
while the consumer is trying to pickup incoming messages, or the likes, will
now be processed as a m [...]
+ "exceptionHandler": { "kind": "parameter", "displayName": "Exception
Handler", "group": "consumer (advanced)", "label": "consumer,advanced",
"required": false, "type": "object", "javaType":
"org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.",
"deprecated": false, "autowired": false, "secret": false, "description": "To
let the consumer use a custom ExceptionHandler. Notice if the option
bridgeErrorHandler is enabled then this option is not in use. By default the
con [...]
+ "exchangePattern": { "kind": "parameter", "displayName": "Exchange
Pattern", "group": "consumer (advanced)", "label": "consumer,advanced",
"required": false, "type": "object", "javaType":
"org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut",
"InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false,
"description": "Sets the exchange pattern when the consumer creates an
exchange." },
+ "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start
Producer", "group": "producer", "label": "producer", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "description": "Whether the producer
should be started lazy (on the first message). By starting lazy you can use
this to allow CamelContext and routes to startup in situations where a producer
may otherwise fail during sta [...]
+ }
+}
diff --git
a/components/camel-kamelet-reify/src/main/docs/kamelet-reify-component.adoc
b/components/camel-kamelet-reify/src/main/docs/kamelet-reify-component.adoc
new file mode 100644
index 0000000..6355228
--- /dev/null
+++ b/components/camel-kamelet-reify/src/main/docs/kamelet-reify-component.adoc
@@ -0,0 +1,82 @@
+[[kamelet-reify-component]]
+= Kamelet Reify Component
+:docTitle: Kamelet Reify
+:artifactId: camel-kamelet-reify
+:description: To call Kamelets (indirectly)
+:since: 3.6
+:supportLevel: Stable
+:component-header: Both producer and consumer are supported
+:core:
+include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/kamelet-reify.adoc[opts=optional]
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The Kamelet Reify Component provides support for calling endpoints that are
isolatated (a.k.a. _local mode_).
+This is needed by Kamelets to ensure they are isolated and independent.
+
+IMPORTANT: The *camel-kamelet-reify* component is becoming obsolete, as
Kamelets (route templates) has support for local beans,
+which is the recommended practice to use for building Kamelets that are
isolated and independent.
+Therefore this component is expected to become deprecated in the near future
and removed later.
+
+== Options
+
+
+
+// component options: START
+The Kamelet Reify component supports 3 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy
(on the first message). By starting lazy you can use this to allow CamelContext
and routes to startup in situations where a producer may otherwise fail during
starting and cause the route to fail being started. By deferring this startup
to be lazy then the startup failure can be handled during routing messages via
Camel's routing error handlers. Beware that when the first message is processed
then creating and [...]
+| *autowiredEnabled* (advanced) | 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. | true | boolean
+|===
+// component options: END
+
+
+
+
+// endpoint options: START
+The Kamelet Reify endpoint is configured using URI syntax:
+
+----
+kamelet-reify:delegateUri
+----
+
+with the following path and query parameters:
+
+=== Path Parameters (1 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *delegateUri* | *Required* The delegated uri | | String
+|===
+
+
+=== Query Parameters (4 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
+| *exceptionHandler* (consumer) | To let the consumer use a custom
ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this
option is not in use. By default the consumer will deal with exceptions, that
will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
+| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer
creates an exchange. There are 3 enums and the value can be one of: InOnly,
InOut, InOptionalOut | | ExchangePattern
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy
(on the first message). By starting lazy you can use this to allow CamelContext
and routes to startup in situations where a producer may otherwise fail during
starting and cause the route to fail being started. By deferring this startup
to be lazy then the startup failure can be handled during routing messages via
Camel's routing error handlers. Beware that when the first message is processed
then creating and [...]
+|===
+// endpoint options: END
+
+[NOTE]
+====
+The *kamelet-reify* endpoint is *lenient*, which means that the endpoint
accepts additional parameters that are passed to the route template engine and
consumed upon route materialization.
+====
+
+
+//include::{page-component-version}@camel-spring-boot::page$kamelet-reify-starter.adoc[]
diff --git
a/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReify.java
b/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReify.java
new file mode 100644
index 0000000..051075a
--- /dev/null
+++
b/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReify.java
@@ -0,0 +1,45 @@
+/*
+ * 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.component.kameletreify;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Component;
+import org.apache.camel.ExtendedCamelContext;
+
+public final class KameletReify {
+ public static final String SCHEME = "kamelet-reify";
+
+ private KameletReify() {
+ }
+
+ public static Component newComponentInstance(CamelContext context, String
scheme) throws Exception {
+ // first check if there's an instance of the given component in the
registry
+ Component answer = context.getRegistry().lookupByNameAndType(scheme,
Component.class);
+ if (answer != null) {
+ // and then create a new instance using it's class
+ return context.getInjector().newInstance(answer.getClass());
+ }
+
+ // if not, fallback to the factory finder way
+ answer =
context.adapt(ExtendedCamelContext.class).getComponentResolver().resolveComponent(scheme,
context);
+ if (answer == null) {
+ throw new IllegalStateException("Unable to create an instance of
the component with scheme: " + scheme);
+ }
+
+ return answer;
+ }
+}
diff --git
a/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReifyComponent.java
b/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReifyComponent.java
new file mode 100644
index 0000000..0066d0a
--- /dev/null
+++
b/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReifyComponent.java
@@ -0,0 +1,91 @@
+/*
+ * 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.component.kameletreify;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.support.PropertyBindingSupport;
+import org.apache.camel.util.StringHelper;
+import org.apache.camel.util.URISupport;
+import org.apache.camel.util.UnsafeUriCharactersEncoder;
+
+@Component(KameletReify.SCHEME)
+public class KameletReifyComponent extends DefaultComponent {
+ private static final AtomicInteger COUNTER = new AtomicInteger();
+
+ public KameletReifyComponent() {
+ this(null);
+ }
+
+ public KameletReifyComponent(CamelContext context) {
+ super(context);
+ }
+
+ @Override
+ protected Endpoint createEndpoint(String uri, String remaining,
Map<String, Object> parameters) throws Exception {
+ final String query;
+
+ int idx = uri.indexOf('?');
+ if (idx > -1) {
+ query = uri.substring(idx + 1);
+ } else {
+ final String encoded = UnsafeUriCharactersEncoder.encode(uri);
+ final URI u = new URI(encoded);
+
+ query = u.getRawQuery();
+ }
+
+ final Map<String, Object> queryParams = URISupport.parseQuery(query,
true);
+ final String scheme = StringHelper.before(remaining, ":");
+ final String path = StringHelper.after(remaining, ":");
+ final String newScheme = scheme + "-" + COUNTER.getAndIncrement();
+ final org.apache.camel.Component newComponent =
KameletReify.newComponentInstance(getCamelContext(), scheme);
+
+ for (Map.Entry<String, Object> entry : parameters.entrySet()) {
+ String key = entry.getKey();
+ Object val = entry.getValue();
+
+ boolean bound = PropertyBindingSupport.build()
+
.withConfigurer(newComponent.getComponentPropertyConfigurer())
+ .withReference(true)
+ .withRemoveParameters(true)
+ .bind(getCamelContext(), newComponent, key, val);
+
+ if (bound) {
+ queryParams.remove(key);
+ }
+ }
+
+ getCamelContext().addComponent(newScheme, newComponent);
+
+ return new KameletReifyEndpoint(
+ uri,
+ this,
+ URISupport.appendParametersToURI(newScheme + ":" + path,
queryParams));
+ }
+
+ @Override
+ public boolean useRawUri() {
+ return true;
+ }
+}
diff --git
a/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReifyEndpoint.java
b/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReifyEndpoint.java
new file mode 100644
index 0000000..e1240ba
--- /dev/null
+++
b/components/camel-kamelet-reify/src/main/java/org/apache/camel/component/kameletreify/KameletReifyEndpoint.java
@@ -0,0 +1,162 @@
+/*
+ * 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.component.kameletreify;
+
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.AsyncProducer;
+import org.apache.camel.Category;
+import org.apache.camel.Consumer;
+import org.apache.camel.DelegateEndpoint;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.DefaultAsyncProducer;
+import org.apache.camel.support.DefaultConsumer;
+import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.support.service.ServiceHelper;
+
+@UriEndpoint(firstVersion = "3.6.0",
+ scheme = "kamelet-reify",
+ syntax = "kamelet-reify:delegateUri",
+ title = "Kamelet Reify",
+ lenientProperties = true,
+ category = Category.CORE)
+public class KameletReifyEndpoint extends DefaultEndpoint implements
DelegateEndpoint {
+ @Metadata(required = true)
+ @UriPath(description = "The delegated uri")
+ private final String delegateUri;
+
+ private final Endpoint delegateEndpoint;
+
+ public KameletReifyEndpoint(String uri, KameletReifyComponent component,
String delegateUri) {
+ super(uri, component);
+
+ this.delegateUri = delegateUri;
+ this.delegateEndpoint =
component.getCamelContext().getEndpoint(delegateUri);
+ }
+
+ public String getDelegateUri() {
+ return delegateUri;
+ }
+
+ @Override
+ public Endpoint getEndpoint() {
+ return delegateEndpoint;
+ }
+
+ @Override
+ public KameletReifyComponent getComponent() {
+ return (KameletReifyComponent) super.getComponent();
+ }
+
+ @Override
+ public boolean isLenientProperties() {
+ return true;
+ }
+
+ @Override
+ public boolean isSingleton() {
+ return false;
+ }
+
+ @Override
+ public Producer createProducer() throws Exception {
+ return new KameletProducer();
+ }
+
+ @Override
+ public Consumer createConsumer(Processor processor) throws Exception {
+ Consumer answer = new KemeletConsumer(processor);
+ configureConsumer(answer);
+ return answer;
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ ServiceHelper.startService(delegateEndpoint);
+ super.doStart();
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ ServiceHelper.stopService(delegateEndpoint);
+ super.doStart();
+ }
+
+ // *********************************
+ //
+ // Helpers
+ //
+ // *********************************
+
+ private class KemeletConsumer extends DefaultConsumer {
+ private volatile Consumer consumer;
+
+ public KemeletConsumer(Processor processor) {
+ super(KameletReifyEndpoint.this, processor);
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ consumer = delegateEndpoint.createConsumer(getProcessor());
+
+ ServiceHelper.startService(consumer);
+ super.doStart();
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ ServiceHelper.stopService(consumer);
+ super.doStop();
+ }
+ }
+
+ private class KameletProducer extends DefaultAsyncProducer {
+ private volatile AsyncProducer producer;
+
+ public KameletProducer() {
+ super(KameletReifyEndpoint.this);
+ }
+
+ @Override
+ public boolean process(Exchange exchange, AsyncCallback callback) {
+ if (producer != null) {
+ return producer.process(exchange, callback);
+ } else {
+ callback.done(true);
+ return true;
+ }
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ producer = delegateEndpoint.createAsyncProducer();
+ ServiceHelper.startService(producer);
+ super.doStart();
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ ServiceHelper.stopService(producer);
+ super.doStop();
+ }
+ }
+}
diff --git
a/components/camel-kamelet-reify/src/test/java/org/apache/camel/component/kameletreify/KameletReifyBasicTest.java
b/components/camel-kamelet-reify/src/test/java/org/apache/camel/component/kameletreify/KameletReifyBasicTest.java
new file mode 100644
index 0000000..2852604
--- /dev/null
+++
b/components/camel-kamelet-reify/src/test/java/org/apache/camel/component/kameletreify/KameletReifyBasicTest.java
@@ -0,0 +1,116 @@
+/*
+ * 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.component.kameletreify;
+
+import java.util.Properties;
+
+import javax.jms.ConnectionFactory;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.PropertyInject;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.testcontainers.junit5.ContainerAwareTestSupport;
+import org.apache.http.annotation.Obsolete;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.Wait;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class KameletReifyBasicTest extends ContainerAwareTestSupport {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(KameletReifyBasicTest.class);
+ private static final String CONTAINER_NAME = "activemq";
+ private static final String CONTAINER_IMAGE =
"rmohr/activemq:5.15.9-alpine";
+ private static final int TCP_PORT = 61616;
+ private static final String QUEUE_NAME = "my-queue";
+
+ @Test
+ public void componentsAreWrapped() throws Exception {
+ assertThat(context().getComponentNames())
+ .filteredOn(n -> n.startsWith("activemq-"))
+ .hasSize(2);
+
+ assertThat(context().getEndpoints())
+ .filteredOn(e -> e.getEndpointUri().startsWith("activemq-"))
+ .hasSize(2);
+ assertThat(context().getEndpoints())
+ .filteredOn(e -> e.getEndpointUri().startsWith("activemq:"))
+ .isEmpty();
+
+ getMockEndpoint("mock:result")
+ .expectedBodiesReceived("test");
+
+ fluentTemplate()
+ .to("direct:start")
+ .withBody("test")
+ .send();
+
+ getMockEndpoint("mock:result")
+ .assertIsSatisfied();
+ }
+
+ // **********************************************
+ //
+ // test set-up
+ //
+ // **********************************************
+
+ @Obsolete
+ protected RoutesBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+
.to("kamelet-reify:activemq:{{amqQueueName}}?brokerURL={{amqBrokerUrl}}");
+
from("kamelet-reify:activemq:{{amqQueueName}}?connectionFactory=#amqcf")
+ .to("mock:result");
+ }
+ };
+ }
+
+ @Override
+ protected GenericContainer<?> createContainer() {
+ return new GenericContainer<>(CONTAINER_IMAGE)
+ .withNetworkAliases(CONTAINER_NAME)
+ .withExposedPorts(TCP_PORT)
+ .withLogConsumer(new Slf4jLogConsumer(LOGGER))
+ .waitingFor(Wait.forListeningPort());
+ }
+
+ @Override
+ protected Properties useOverridePropertiesWithPropertiesComponent() {
+ final String host = getContainerHost(CONTAINER_NAME);
+ final int port = getContainerPort(CONTAINER_NAME, TCP_PORT);
+ final String brokerUrl = String.format("tcp://%s:%d", host, port);
+
+ Properties properties = new Properties();
+ properties.setProperty("amqBrokerUrl", brokerUrl);
+ properties.setProperty("amqQueueName", QUEUE_NAME);
+
+ return properties;
+ }
+
+ @BindToRegistry("amqcf")
+ public ConnectionFactory
activeMQConnectionFactory(@PropertyInject("amqBrokerUrl") String brokerUrl) {
+ return new ActiveMQConnectionFactory(brokerUrl);
+ }
+}
diff --git a/components/camel-kamelet-reify/src/test/resources/log4j2-test.xml
b/components/camel-kamelet-reify/src/test/resources/log4j2-test.xml
new file mode 100644
index 0000000..9721446
--- /dev/null
+++ b/components/camel-kamelet-reify/src/test/resources/log4j2-test.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<Configuration status="INFO">
+ <Appenders>
+ <Console name="STDOUT" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS}|%-5level|%t|%c{1} -
%msg%n"/>
+ </Console>
+ <File name="FILE" filename="target/camel-kamelet-reify-test.log">
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} -
%msg%n"/>
+ </File>
+ <Null name="NONE"/>
+ </Appenders>
+
+ <Loggers>
+ <Logger name="org.apache.camel.component.kameletreify" level="TRACE"/>
+
+ <Root level="INFO">
+ <!--
+ <AppenderRef ref="STDOUT"/>
+ -->
+ <AppenderRef ref="FILE"/>
+ </Root>
+ </Loggers>
+
+</Configuration>
\ No newline at end of file
diff --git a/components/pom.xml b/components/pom.xml
index b2ee832..607c800 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -212,6 +212,7 @@
<module>camel-jta</module>
<module>camel-kafka</module>
<module>camel-kamelet</module>
+ <module>camel-kamelet-reify</module>
<module>camel-kubernetes</module>
<module>camel-kudu</module>
<module>camel-ldap</module>
diff --git a/core/camel-allcomponents/pom.xml b/core/camel-allcomponents/pom.xml
index 8a6a0c6..e0b8b93 100644
--- a/core/camel-allcomponents/pom.xml
+++ b/core/camel-allcomponents/pom.xml
@@ -791,6 +791,10 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-kamelet-reify</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-kamelet</artifactId>
</dependency>
<dependency>
diff --git
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index 8b43104..5cbfe0f 100644
---
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -2541,6 +2541,19 @@ public interface ComponentsBuilderFactory {
return
org.apache.camel.builder.component.dsl.KameletComponentBuilderFactory.kamelet();
}
/**
+ * Kamelet Reify (camel-kamelet-reify)
+ * To call Kamelets (indirectly)
+ *
+ * Category: core
+ * Since: 3.6
+ * Maven coordinates: org.apache.camel:camel-kamelet-reify
+ *
+ * @return the dsl builder
+ */
+ static
org.apache.camel.builder.component.dsl.KameletReifyComponentBuilderFactory.KameletReifyComponentBuilder
kameletReify() {
+ return
org.apache.camel.builder.component.dsl.KameletReifyComponentBuilderFactory.kameletReify();
+ }
+ /**
* Kubernetes ConfigMap (camel-kubernetes)
* Perform operations on Kubernetes ConfigMaps and get notified on
* ConfigMaps changes.
diff --git
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/KameletReifyComponentBuilderFactory.java
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/KameletReifyComponentBuilderFactory.java
new file mode 100644
index 0000000..8e9c181
--- /dev/null
+++
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/KameletReifyComponentBuilderFactory.java
@@ -0,0 +1,144 @@
+/*
+ * 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.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.kameletreify.KameletReifyComponent;
+
+/**
+ * To call Kamelets (indirectly)
+ *
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
+public interface KameletReifyComponentBuilderFactory {
+
+ /**
+ * Kamelet Reify (camel-kamelet-reify)
+ * To call Kamelets (indirectly)
+ *
+ * Category: core
+ * Since: 3.6
+ * Maven coordinates: org.apache.camel:camel-kamelet-reify
+ *
+ * @return the dsl builder
+ */
+ static KameletReifyComponentBuilder kameletReify() {
+ return new KameletReifyComponentBuilderImpl();
+ }
+
+ /**
+ * Builder for the Kamelet Reify component.
+ */
+ interface KameletReifyComponentBuilder
+ extends
+ ComponentBuilder<KameletReifyComponent> {
+ /**
+ * Allows for bridging the consumer to the Camel routing Error Handler,
+ * which mean any exceptions occurred while the consumer is trying to
+ * pickup incoming messages, or the likes, will now be processed as a
+ * message and handled by the routing Error Handler. 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: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: consumer
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default KameletReifyComponentBuilder bridgeErrorHandler(
+ boolean bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+ /**
+ * Whether the producer should be started lazy (on the first message).
+ * By starting lazy you can use this to allow CamelContext and routes
to
+ * startup in situations where a producer may otherwise fail during
+ * starting and cause the route to fail being started. By deferring
this
+ * startup to be lazy then the startup failure can be handled during
+ * routing messages via Camel's routing error handlers. Beware that
when
+ * the first message is processed then creating and starting the
+ * producer may take a little time and prolong the total processing
time
+ * of the processing.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param lazyStartProducer the value to set
+ * @return the dsl builder
+ */
+ default KameletReifyComponentBuilder lazyStartProducer(
+ boolean lazyStartProducer) {
+ doSetProperty("lazyStartProducer", lazyStartProducer);
+ 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: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: advanced
+ *
+ * @param autowiredEnabled the value to set
+ * @return the dsl builder
+ */
+ default KameletReifyComponentBuilder autowiredEnabled(
+ boolean autowiredEnabled) {
+ doSetProperty("autowiredEnabled", autowiredEnabled);
+ return this;
+ }
+ }
+
+ class KameletReifyComponentBuilderImpl
+ extends
+ AbstractComponentBuilder<KameletReifyComponent>
+ implements
+ KameletReifyComponentBuilder {
+ @Override
+ protected KameletReifyComponent buildConcreteComponent() {
+ return new KameletReifyComponent();
+ }
+ @Override
+ protected boolean setPropertyOnComponent(
+ Component component,
+ String name,
+ Object value) {
+ switch (name) {
+ case "bridgeErrorHandler": ((KameletReifyComponent)
component).setBridgeErrorHandler((boolean) value); return true;
+ case "lazyStartProducer": ((KameletReifyComponent)
component).setLazyStartProducer((boolean) value); return true;
+ case "autowiredEnabled": ((KameletReifyComponent)
component).setAutowiredEnabled((boolean) value); return true;
+ default: return false;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/core/camel-componentdsl/src/generated/resources/metadata.json
b/core/camel-componentdsl/src/generated/resources/metadata.json
index edc0f24..358e64d 100644
--- a/core/camel-componentdsl/src/generated/resources/metadata.json
+++ b/core/camel-componentdsl/src/generated/resources/metadata.json
@@ -4170,6 +4170,28 @@
"producerOnly": false,
"lenientProperties": true
},
+ "KameletReifyComponentBuilderFactory": {
+ "kind": "component",
+ "name": "kamelet-reify",
+ "title": "Kamelet Reify",
+ "description": "To call Kamelets (indirectly)",
+ "deprecated": false,
+ "firstVersion": "3.6.0",
+ "label": "core",
+ "javaType":
"org.apache.camel.component.kameletreify.KameletReifyComponent",
+ "supportLevel": "Stable",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-kamelet-reify",
+ "version": "3.10.0-SNAPSHOT",
+ "scheme": "kamelet-reify",
+ "extendsScheme": "",
+ "syntax": "kamelet-reify:delegateUri",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": false,
+ "lenientProperties": true
+ },
"KubernetesConfigMapsComponentBuilderFactory": {
"kind": "component",
"name": "kubernetes-config-maps",
diff --git
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
index 14c1c42..0bd933e 100644
---
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
+++
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
@@ -198,6 +198,7 @@ public interface EndpointBuilderFactory
org.apache.camel.builder.endpoint.dsl.KMS2EndpointBuilderFactory.KMS2Builders,
org.apache.camel.builder.endpoint.dsl.KafkaEndpointBuilderFactory.KafkaBuilders,
org.apache.camel.builder.endpoint.dsl.KameletEndpointBuilderFactory.KameletBuilders,
+
org.apache.camel.builder.endpoint.dsl.KameletReifyEndpointBuilderFactory.KameletReifyBuilders,
org.apache.camel.builder.endpoint.dsl.KeystoneEndpointBuilderFactory.KeystoneBuilders,
org.apache.camel.builder.endpoint.dsl.Kinesis2EndpointBuilderFactory.Kinesis2Builders,
org.apache.camel.builder.endpoint.dsl.KinesisFirehose2EndpointBuilderFactory.KinesisFirehose2Builders,
diff --git
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
index e53ae81..16bf97a 100644
---
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
+++
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
@@ -195,6 +195,7 @@ public interface EndpointBuilders
org.apache.camel.builder.endpoint.dsl.KMS2EndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.KafkaEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.KameletEndpointBuilderFactory,
+
org.apache.camel.builder.endpoint.dsl.KameletReifyEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.KeystoneEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.Kinesis2EndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.KinesisFirehose2EndpointBuilderFactory,
diff --git
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 5e14c24..5f62601 100644
---
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -8647,6 +8647,49 @@ public class StaticEndpointBuilders {
return
org.apache.camel.builder.endpoint.dsl.KameletEndpointBuilderFactory.endpointBuilder(componentName,
path);
}
/**
+ * Kamelet Reify (camel-kamelet-reify)
+ * To call Kamelets (indirectly)
+ *
+ * Category: core
+ * Since: 3.6
+ * Maven coordinates: org.apache.camel:camel-kamelet-reify
+ *
+ * Syntax: <code>kamelet-reify:delegateUri</code>
+ *
+ * Path parameter: delegateUri (required)
+ * The delegated uri
+ *
+ * @param path delegateUri
+ * @return the dsl builder
+ */
+ public static
org.apache.camel.builder.endpoint.dsl.KameletReifyEndpointBuilderFactory.KameletReifyEndpointBuilder
kameletReify(
+ String path) {
+ return
org.apache.camel.builder.endpoint.dsl.KameletReifyEndpointBuilderFactory.endpointBuilder("kamelet-reify",
path);
+ }
+ /**
+ * Kamelet Reify (camel-kamelet-reify)
+ * To call Kamelets (indirectly)
+ *
+ * Category: core
+ * Since: 3.6
+ * Maven coordinates: org.apache.camel:camel-kamelet-reify
+ *
+ * Syntax: <code>kamelet-reify:delegateUri</code>
+ *
+ * Path parameter: delegateUri (required)
+ * The delegated uri
+ *
+ * @param componentName to use a custom component name for the endpoint
+ * instead of the default name
+ * @param path delegateUri
+ * @return the dsl builder
+ */
+ public static
org.apache.camel.builder.endpoint.dsl.KameletReifyEndpointBuilderFactory.KameletReifyEndpointBuilder
kameletReify(
+ String componentName,
+ String path) {
+ return
org.apache.camel.builder.endpoint.dsl.KameletReifyEndpointBuilderFactory.endpointBuilder(componentName,
path);
+ }
+ /**
* Kubernetes ConfigMap (camel-kubernetes)
* Perform operations on Kubernetes ConfigMaps and get notified on
* ConfigMaps changes.
diff --git
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KameletReifyEndpointBuilderFactory.java
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KameletReifyEndpointBuilderFactory.java
new file mode 100644
index 0000000..ca08a57
--- /dev/null
+++
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KameletReifyEndpointBuilderFactory.java
@@ -0,0 +1,321 @@
+/*
+ * 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.endpoint.dsl;
+
+import javax.annotation.Generated;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.builder.EndpointConsumerBuilder;
+import org.apache.camel.builder.EndpointProducerBuilder;
+import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
+import org.apache.camel.spi.ExceptionHandler;
+
+/**
+ * To call Kamelets (indirectly)
+ *
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
+public interface KameletReifyEndpointBuilderFactory {
+
+
+ /**
+ * Builder for endpoint consumers for the Kamelet Reify component.
+ */
+ public interface KameletReifyEndpointConsumerBuilder
+ extends
+ EndpointConsumerBuilder {
+ default AdvancedKameletReifyEndpointConsumerBuilder advanced() {
+ return (AdvancedKameletReifyEndpointConsumerBuilder) this;
+ }
+ /**
+ * Allows for bridging the consumer to the Camel routing Error Handler,
+ * which mean any exceptions occurred while the consumer is trying to
+ * pickup incoming messages, or the likes, will now be processed as a
+ * message and handled by the routing Error Handler. 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: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: consumer
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default KameletReifyEndpointConsumerBuilder bridgeErrorHandler(
+ boolean bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+ /**
+ * Allows for bridging the consumer to the Camel routing Error Handler,
+ * which mean any exceptions occurred while the consumer is trying to
+ * pickup incoming messages, or the likes, will now be processed as a
+ * message and handled by the routing Error Handler. 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 will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: false
+ * Group: consumer
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default KameletReifyEndpointConsumerBuilder bridgeErrorHandler(
+ String bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+ }
+
+ /**
+ * Advanced builder for endpoint consumers for the Kamelet Reify component.
+ */
+ public interface AdvancedKameletReifyEndpointConsumerBuilder
+ extends
+ EndpointConsumerBuilder {
+ default KameletReifyEndpointConsumerBuilder basic() {
+ return (KameletReifyEndpointConsumerBuilder) this;
+ }
+ /**
+ * To let the consumer use a custom ExceptionHandler. Notice if the
+ * option bridgeErrorHandler is enabled then this option is not in use.
+ * By default the consumer will deal with exceptions, that will be
+ * logged at WARN or ERROR level and ignored.
+ *
+ * The option is a:
+ * <code>org.apache.camel.spi.ExceptionHandler</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exceptionHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedKameletReifyEndpointConsumerBuilder exceptionHandler(
+ ExceptionHandler exceptionHandler) {
+ doSetProperty("exceptionHandler", exceptionHandler);
+ return this;
+ }
+ /**
+ * To let the consumer use a custom ExceptionHandler. Notice if the
+ * option bridgeErrorHandler is enabled then this option is not in use.
+ * By default the consumer will deal with exceptions, that will be
+ * logged at WARN or ERROR level and ignored.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.spi.ExceptionHandler</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exceptionHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedKameletReifyEndpointConsumerBuilder exceptionHandler(
+ String exceptionHandler) {
+ doSetProperty("exceptionHandler", exceptionHandler);
+ return this;
+ }
+ /**
+ * Sets the exchange pattern when the consumer creates an exchange.
+ *
+ * The option is a:
+ * <code>org.apache.camel.ExchangePattern</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exchangePattern the value to set
+ * @return the dsl builder
+ */
+ default AdvancedKameletReifyEndpointConsumerBuilder exchangePattern(
+ ExchangePattern exchangePattern) {
+ doSetProperty("exchangePattern", exchangePattern);
+ return this;
+ }
+ /**
+ * Sets the exchange pattern when the consumer creates an exchange.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.ExchangePattern</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exchangePattern the value to set
+ * @return the dsl builder
+ */
+ default AdvancedKameletReifyEndpointConsumerBuilder exchangePattern(
+ String exchangePattern) {
+ doSetProperty("exchangePattern", exchangePattern);
+ return this;
+ }
+ }
+
+ /**
+ * Builder for endpoint producers for the Kamelet Reify component.
+ */
+ public interface KameletReifyEndpointProducerBuilder
+ extends
+ EndpointProducerBuilder {
+ default AdvancedKameletReifyEndpointProducerBuilder advanced() {
+ return (AdvancedKameletReifyEndpointProducerBuilder) this;
+ }
+ /**
+ * Whether the producer should be started lazy (on the first message).
+ * By starting lazy you can use this to allow CamelContext and routes
to
+ * startup in situations where a producer may otherwise fail during
+ * starting and cause the route to fail being started. By deferring
this
+ * startup to be lazy then the startup failure can be handled during
+ * routing messages via Camel's routing error handlers. Beware that
when
+ * the first message is processed then creating and starting the
+ * producer may take a little time and prolong the total processing
time
+ * of the processing.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param lazyStartProducer the value to set
+ * @return the dsl builder
+ */
+ default KameletReifyEndpointProducerBuilder lazyStartProducer(
+ boolean lazyStartProducer) {
+ doSetProperty("lazyStartProducer", lazyStartProducer);
+ return this;
+ }
+ /**
+ * Whether the producer should be started lazy (on the first message).
+ * By starting lazy you can use this to allow CamelContext and routes
to
+ * startup in situations where a producer may otherwise fail during
+ * starting and cause the route to fail being started. By deferring
this
+ * startup to be lazy then the startup failure can be handled during
+ * routing messages via Camel's routing error handlers. Beware that
when
+ * the first message is processed then creating and starting the
+ * producer may take a little time and prolong the total processing
time
+ * of the processing.
+ *
+ * The option will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param lazyStartProducer the value to set
+ * @return the dsl builder
+ */
+ default KameletReifyEndpointProducerBuilder lazyStartProducer(
+ String lazyStartProducer) {
+ doSetProperty("lazyStartProducer", lazyStartProducer);
+ return this;
+ }
+ }
+
+ /**
+ * Advanced builder for endpoint producers for the Kamelet Reify component.
+ */
+ public interface AdvancedKameletReifyEndpointProducerBuilder
+ extends
+ EndpointProducerBuilder {
+ default KameletReifyEndpointProducerBuilder basic() {
+ return (KameletReifyEndpointProducerBuilder) this;
+ }
+ }
+
+ /**
+ * Builder for endpoint for the Kamelet Reify component.
+ */
+ public interface KameletReifyEndpointBuilder
+ extends
+ KameletReifyEndpointConsumerBuilder,
+ KameletReifyEndpointProducerBuilder {
+ default AdvancedKameletReifyEndpointBuilder advanced() {
+ return (AdvancedKameletReifyEndpointBuilder) this;
+ }
+ }
+
+ /**
+ * Advanced builder for endpoint for the Kamelet Reify component.
+ */
+ public interface AdvancedKameletReifyEndpointBuilder
+ extends
+ AdvancedKameletReifyEndpointConsumerBuilder,
+ AdvancedKameletReifyEndpointProducerBuilder {
+ default KameletReifyEndpointBuilder basic() {
+ return (KameletReifyEndpointBuilder) this;
+ }
+ }
+
+ public interface KameletReifyBuilders {
+ /**
+ * Kamelet Reify (camel-kamelet-reify)
+ * To call Kamelets (indirectly)
+ *
+ * Category: core
+ * Since: 3.6
+ * Maven coordinates: org.apache.camel:camel-kamelet-reify
+ *
+ * Syntax: <code>kamelet-reify:delegateUri</code>
+ *
+ * Path parameter: delegateUri (required)
+ * The delegated uri
+ *
+ * @param path delegateUri
+ * @return the dsl builder
+ */
+ default KameletReifyEndpointBuilder kameletReify(String path) {
+ return
KameletReifyEndpointBuilderFactory.endpointBuilder("kamelet-reify", path);
+ }
+ /**
+ * Kamelet Reify (camel-kamelet-reify)
+ * To call Kamelets (indirectly)
+ *
+ * Category: core
+ * Since: 3.6
+ * Maven coordinates: org.apache.camel:camel-kamelet-reify
+ *
+ * Syntax: <code>kamelet-reify:delegateUri</code>
+ *
+ * Path parameter: delegateUri (required)
+ * The delegated uri
+ *
+ * @param componentName to use a custom component name for the endpoint
+ * instead of the default name
+ * @param path delegateUri
+ * @return the dsl builder
+ */
+ default KameletReifyEndpointBuilder kameletReify(
+ String componentName,
+ String path) {
+ return
KameletReifyEndpointBuilderFactory.endpointBuilder(componentName, path);
+ }
+ }
+ static KameletReifyEndpointBuilder endpointBuilder(
+ String componentName,
+ String path) {
+ class KameletReifyEndpointBuilderImpl extends AbstractEndpointBuilder
implements KameletReifyEndpointBuilder, AdvancedKameletReifyEndpointBuilder {
+ public KameletReifyEndpointBuilderImpl(String path) {
+ super(componentName, path);
+ }
+ }
+ return new KameletReifyEndpointBuilderImpl(path);
+ }
+}
\ No newline at end of file
diff --git
a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
index 880faef..a1e8bcb 100644
---
a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
+++
b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
@@ -186,6 +186,7 @@ jsonata
jt400
kafka
kamelet
+kamelet-reify
kubernetes-config-maps
kubernetes-custom-resources
kubernetes-deployments
diff --git a/docs/components/modules/ROOT/nav.adoc
b/docs/components/modules/ROOT/nav.adoc
index 788a1af..66fae5f 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -188,6 +188,7 @@
** xref:jt400-component.adoc[JT400]
** xref:kafka-component.adoc[Kafka]
** xref:kamelet-component.adoc[Kamelet]
+** xref:kamelet-reify-component.adoc[Kamelet Reify]
** xref:kubernetes-summary.adoc[Kubernetes]
*** xref:kubernetes-config-maps-component.adoc[Kubernetes ConfigMap]
*** xref:kubernetes-custom-resources-component.adoc[Kubernetes Custom
Resources]
diff --git a/docs/components/modules/ROOT/pages/kamelet-reify-component.adoc
b/docs/components/modules/ROOT/pages/kamelet-reify-component.adoc
new file mode 100644
index 0000000..e4ecab9
--- /dev/null
+++ b/docs/components/modules/ROOT/pages/kamelet-reify-component.adoc
@@ -0,0 +1,84 @@
+[[kamelet-reify-component]]
+= Kamelet Reify Component
+//THIS FILE IS COPIED: EDIT THE SOURCE FILE:
+:page-source:
components/camel-kamelet-reify/src/main/docs/kamelet-reify-component.adoc
+:docTitle: Kamelet Reify
+:artifactId: camel-kamelet-reify
+:description: To call Kamelets (indirectly)
+:since: 3.6
+:supportLevel: Stable
+:component-header: Both producer and consumer are supported
+:core:
+include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/kamelet-reify.adoc[opts=optional]
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The Kamelet Reify Component provides support for calling endpoints that are
isolatated (a.k.a. _local mode_).
+This is needed by Kamelets to ensure they are isolated and independent.
+
+IMPORTANT: The *camel-kamelet-reify* component is becoming obsolete, as
Kamelets (route templates) has support for local beans,
+which is the recommended practice to use for building Kamelets that are
isolated and independent.
+Therefore this component is expected to become deprecated in the near future
and removed later.
+
+== Options
+
+
+
+// component options: START
+The Kamelet Reify component supports 3 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy
(on the first message). By starting lazy you can use this to allow CamelContext
and routes to startup in situations where a producer may otherwise fail during
starting and cause the route to fail being started. By deferring this startup
to be lazy then the startup failure can be handled during routing messages via
Camel's routing error handlers. Beware that when the first message is processed
then creating and [...]
+| *autowiredEnabled* (advanced) | 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. | true | boolean
+|===
+// component options: END
+
+
+
+
+// endpoint options: START
+The Kamelet Reify endpoint is configured using URI syntax:
+
+----
+kamelet-reify:delegateUri
+----
+
+with the following path and query parameters:
+
+=== Path Parameters (1 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *delegateUri* | *Required* The delegated uri | | String
+|===
+
+
+=== Query Parameters (4 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
+| *exceptionHandler* (consumer) | To let the consumer use a custom
ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this
option is not in use. By default the consumer will deal with exceptions, that
will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
+| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer
creates an exchange. There are 3 enums and the value can be one of: InOnly,
InOut, InOptionalOut | | ExchangePattern
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy
(on the first message). By starting lazy you can use this to allow CamelContext
and routes to startup in situations where a producer may otherwise fail during
starting and cause the route to fail being started. By deferring this startup
to be lazy then the startup failure can be handled during routing messages via
Camel's routing error handlers. Beware that when the first message is processed
then creating and [...]
+|===
+// endpoint options: END
+
+[NOTE]
+====
+The *kamelet-reify* endpoint is *lenient*, which means that the endpoint
accepts additional parameters that are passed to the route template engine and
consumed upon route materialization.
+====
+
+
+//include::{page-component-version}@camel-spring-boot::page$kamelet-reify-starter.adoc[]
diff --git a/parent/pom.xml b/parent/pom.xml
index ad2b74c..d01e97e 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1772,6 +1772,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-kamelet-reify</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-kamelet</artifactId>
<version>${project.version}</version>
</dependency>