You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2025/04/12 08:48:28 UTC
(camel) branch main updated: CAMEL-21943 Add a Weaviate component (#17697)
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 00b71c9b1b5 CAMEL-21943 Add a Weaviate component (#17697)
00b71c9b1b5 is described below
commit 00b71c9b1b51d1ce47db68352f69e3c052fc2c18
Author: Tom Cunningham <tc...@redhat.com>
AuthorDate: Sat Apr 12 04:48:22 2025 -0400
CAMEL-21943 Add a Weaviate component (#17697)
* CAMEL-21943 Add a weaviate component
* CAMEL-21943 Add documents for weaviate component
* Fix test endpoint reference; add use of ExchangeHelper.getMandatoryHeader()
* CAMEL-21943 Add weaviate to list of camel-ai components resolved in MojoHelper
---
bom/camel-bom/pom.xml | 5 +
catalog/camel-allcomponents/pom.xml | 5 +
.../org/apache/camel/catalog/components.properties | 1 +
.../apache/camel/catalog/components/weaviate.json | 62 +++
components/camel-ai/camel-weaviate/pom.xml | 82 ++++
.../WeaviateVectorDbComponentConfigurer.java | 97 +++++
.../WeaviateVectorDbConfigurationConfigurer.java | 78 ++++
.../WeaviateVectorDbEndpointConfigurer.java | 81 ++++
.../WeaviateVectorDbEndpointUriFactory.java | 79 ++++
.../apache/camel/component/weaviate/weaviate.json | 62 +++
.../services/org/apache/camel/component.properties | 7 +
.../services/org/apache/camel/component/weaviate | 2 +
...omponent.weaviate.WeaviateVectorDbConfiguration | 2 +
.../org/apache/camel/configurer/weaviate-component | 2 +
.../org/apache/camel/configurer/weaviate-endpoint | 2 +
.../org/apache/camel/urifactory/weaviate-endpoint | 2 +
.../src/main/docs/weaviate-component.adoc | 47 +++
.../camel/component/weaviate/WeaviateVectorDb.java | 68 ++++
.../component/weaviate/WeaviateVectorDbAction.java | 27 ++
.../weaviate/WeaviateVectorDbComponent.java | 71 ++++
.../weaviate/WeaviateVectorDbConfiguration.java | 183 +++++++++
.../weaviate/WeaviateVectorDbEndpoint.java | 143 +++++++
.../weaviate/WeaviateVectorDbProducer.java | 301 ++++++++++++++
.../WeaviateComponentConfigurationTest.java | 67 ++++
.../component/weaviate/it/WeaviateComponentIT.java | 206 ++++++++++
.../src/test/resources/log4j2.properties | 35 ++
.../src/test/resources/weaviate.properties | 22 ++
components/camel-ai/pom.xml | 1 +
.../org/apache/camel/main/components.properties | 1 +
.../modules/ROOT/examples/json/weaviate.json | 1 +
docs/components/modules/ROOT/nav.adoc | 1 +
.../modules/ROOT/pages/weaviate-component.adoc | 1 +
.../component/ComponentsBuilderFactory.java | 13 +
.../dsl/WeaviateComponentBuilderFactory.java | 239 +++++++++++
.../builder/endpoint/EndpointBuilderFactory.java | 1 +
.../camel/builder/endpoint/EndpointBuilders.java | 1 +
.../builder/endpoint/StaticEndpointBuilders.java | 40 ++
.../WeaviateVectorDbEndpointBuilderFactory.java | 438 +++++++++++++++++++++
.../camel-component-known-dependencies.properties | 1 +
parent/pom.xml | 6 +
.../apache/camel/maven/packaging/MojoHelper.java | 3 +-
41 files changed, 2485 insertions(+), 1 deletion(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 7c731552fdc..8d084e23ad7 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -2197,6 +2197,11 @@
<artifactId>camel-weather</artifactId>
<version>4.12.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-weaviate</artifactId>
+ <version>4.12.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-web3j</artifactId>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index e788e909b4f..27a85eee184 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -1966,6 +1966,11 @@
<artifactId>camel-weather</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-weaviate</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-web3j</artifactId>
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 56de12b7e38..f289e17861d 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
@@ -338,6 +338,7 @@ vertx-http
vertx-websocket
wasm
weather
+weaviate
web3j
webhook
whatsapp
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/weaviate.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/weaviate.json
new file mode 100644
index 00000000000..074341d67da
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/weaviate.json
@@ -0,0 +1,62 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "weaviate",
+ "title": "weaviate",
+ "description": "Perform operations on the Weaviate Vector Database.",
+ "deprecated": false,
+ "firstVersion": "4.11.0",
+ "label": "database,ai",
+ "javaType": "org.apache.camel.component.weaviate.WeaviateVectorDbComponent",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-weaviate",
+ "version": "4.12.0-SNAPSHOT",
+ "scheme": "weaviate",
+ "extendsScheme": "",
+ "syntax": "weaviate:collection",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": true,
+ "lenientProperties": false,
+ "browsable": false,
+ "remote": true
+ },
+ "componentProperties": {
+ "apiKey": { "index": 0, "kind": "property", "displayName": "Api Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "API Key to authenticate to weaviate with" },
+ "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration;" },
+ "host": { "index": 2, "kind": "property", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Weaviate server host to connect to" },
+ "lazyStartProducer": { "index": 3, "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 [...]
+ "proxyHost": { "index": 4, "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy host to connect to weaviate through" },
+ "proxyPort": { "index": 5, "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy port to connect to weaviate through" },
+ "proxyScheme": { "index": 6, "kind": "property", "displayName": "Proxy Scheme", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy scheme to connect to weaviate through" },
+ "scheme": { "index": 7, "kind": "property", "displayName": "Scheme", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Scheme used to connect to weaviate" },
+ "autowiredEnabled": { "index": 8, "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 [...]
+ },
+ "headers": {
+ "CamelWeaviateAction": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "CREATE_COLLECTION", "CREATE_INDEX", "UPSERT", "INSERT", "SEARCH", "DELETE", "UPDATE", "QUERY", "QUERY_BY_ID" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The action to be performed.", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#ACTION" },
+ "CamelWeaviateTextFieldName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Text Field Name for Insert\/Upsert operation", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#TEXT_FIELD_NAME" },
+ "CamelweaviateVectorFieldName": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Vector Field Name for Insert\/Upsert operation", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#VECTOR_FIELD_NAME" },
+ "CamelWeaviateCollectionName": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Name for Insert\/Upsert operation", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_NAME" },
+ "CamelWeaviateCollectionSimilarityMetric": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "cosine", "euclidean", "dotproduct" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Similarity Metric", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_SIMILARITY_METRIC" },
+ "CamelWeaviateCollectionDimension": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Dimension", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_DIMENSION" },
+ "CamelWeaviateCollectionCloud": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "aws", "gcp", "azure" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Cloud Vendor", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_CLOUD" },
+ "CamelWeaviateCollectionCloudRegion": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "aws", "gcp", "azure" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Cloud Vendor Region", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_CLOUD_REGION" },
+ "CamelWeaviateIndexName": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Index Name", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#INDEX_NAME" },
+ "CamelWeaviateFields": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "HashMap", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Weaviate Object fields", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#FIELDS" },
+ "CamelWeaviateProperties": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "HashMap", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Weaviate Object properties", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#PROPERTIES" },
+ "CamelWeaviateIndexId": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Index Id", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#INDEX_ID" },
+ "CamelWeaviateQueryTopK": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query Top K", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#QUERY_TOP_K" }
+ },
+ "properties": {
+ "collection": { "index": 0, "kind": "path", "displayName": "Collection", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The collection Name" },
+ "apiKey": { "index": 1, "kind": "parameter", "displayName": "Api Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "API Key to authenticate to weaviate with" },
+ "host": { "index": 2, "kind": "parameter", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Weaviate server host to connect to" },
+ "proxyHost": { "index": 3, "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy host to connect to weaviate through" },
+ "proxyPort": { "index": 4, "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy port to connect to weaviate through" },
+ "proxyScheme": { "index": 5, "kind": "parameter", "displayName": "Proxy Scheme", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy scheme to connect to weaviate through" },
+ "scheme": { "index": 6, "kind": "parameter", "displayName": "Scheme", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Scheme used to connect to weaviate" },
+ "lazyStartProducer": { "index": 7, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "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 produc [...]
+ }
+}
diff --git a/components/camel-ai/camel-weaviate/pom.xml b/components/camel-ai/camel-weaviate/pom.xml
new file mode 100644
index 00000000000..ed145e4e1f4
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/pom.xml
@@ -0,0 +1,82 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>camel-ai-parent</artifactId>
+ <groupId>org.apache.camel</groupId>
+ <version>4.12.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-weaviate</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: AI :: Weaviate</name>
+ <description>Camel Weaviate support</description>
+
+ <properties>
+ <camel.surefire.parallel>true</camel.surefire.parallel>
+ <camel.surefire.parallel.factor>4</camel.surefire.parallel.factor>
+
+ <!-- Milvus is not available on these platforms -->
+ <skipITs.ppc64le>true</skipITs.ppc64le>
+ <skipITs.s390x>true</skipITs.s390x>
+ <skipTests.ppc64le>true</skipTests.ppc64le>
+ <skipTests.s390x>true</skipTests.s390x>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-support</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-core</artifactId>
+ <version>${langchain4j-version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.weaviate</groupId>
+ <artifactId>client</artifactId>
+ <version>${weaviate-client-version}</version>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbComponentConfigurer.java b/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbComponentConfigurer.java
new file mode 100644
index 00000000000..20afb346b32
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbComponentConfigurer.java
@@ -0,0 +1,97 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.weaviate;
+
+import javax.annotation.processing.Generated;
+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!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo")
+@SuppressWarnings("unchecked")
+public class WeaviateVectorDbComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ private org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration getOrCreateConfiguration(WeaviateVectorDbComponent target) {
+ if (target.getConfiguration() == null) {
+ target.setConfiguration(new org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration());
+ }
+ return target.getConfiguration();
+ }
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+ WeaviateVectorDbComponent target = (WeaviateVectorDbComponent) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": getOrCreateConfiguration(target).setApiKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "autowiredenabled":
+ case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
+ case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration.class, value)); return true;
+ case "host": getOrCreateConfiguration(target).setHost(property(camelContext, java.lang.String.class, value)); return true;
+ case "lazystartproducer":
+ case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
+ case "proxyhost":
+ case "proxyHost": getOrCreateConfiguration(target).setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
+ case "proxyport":
+ case "proxyPort": getOrCreateConfiguration(target).setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
+ case "proxyscheme":
+ case "proxyScheme": getOrCreateConfiguration(target).setProxyScheme(property(camelContext, java.lang.String.class, value)); return true;
+ case "scheme": getOrCreateConfiguration(target).setScheme(property(camelContext, java.lang.String.class, value)); return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": return java.lang.String.class;
+ case "autowiredenabled":
+ case "autowiredEnabled": return boolean.class;
+ case "configuration": return org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration.class;
+ case "host": return java.lang.String.class;
+ case "lazystartproducer":
+ case "lazyStartProducer": return boolean.class;
+ case "proxyhost":
+ case "proxyHost": return java.lang.String.class;
+ case "proxyport":
+ case "proxyPort": return java.lang.Integer.class;
+ case "proxyscheme":
+ case "proxyScheme": return java.lang.String.class;
+ case "scheme": return java.lang.String.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ WeaviateVectorDbComponent target = (WeaviateVectorDbComponent) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": return getOrCreateConfiguration(target).getApiKey();
+ case "autowiredenabled":
+ case "autowiredEnabled": return target.isAutowiredEnabled();
+ case "configuration": return target.getConfiguration();
+ case "host": return getOrCreateConfiguration(target).getHost();
+ case "lazystartproducer":
+ case "lazyStartProducer": return target.isLazyStartProducer();
+ case "proxyhost":
+ case "proxyHost": return getOrCreateConfiguration(target).getProxyHost();
+ case "proxyport":
+ case "proxyPort": return getOrCreateConfiguration(target).getProxyPort();
+ case "proxyscheme":
+ case "proxyScheme": return getOrCreateConfiguration(target).getProxyScheme();
+ case "scheme": return getOrCreateConfiguration(target).getScheme();
+ default: return null;
+ }
+ }
+}
+
diff --git a/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbConfigurationConfigurer.java b/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbConfigurationConfigurer.java
new file mode 100644
index 00000000000..68a021aafce
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbConfigurationConfigurer.java
@@ -0,0 +1,78 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.weaviate;
+
+import javax.annotation.processing.Generated;
+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.component.weaviate.WeaviateVectorDbConfiguration;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.GenerateConfigurerMojo")
+@SuppressWarnings("unchecked")
+public class WeaviateVectorDbConfigurationConfigurer extends org.apache.camel.support.component.PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+ org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration target = (org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": target.setApiKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "client": target.setClient(property(camelContext, io.weaviate.client.WeaviateClient.class, value)); return true;
+ case "host": target.setHost(property(camelContext, java.lang.String.class, value)); return true;
+ case "proxyhost":
+ case "proxyHost": target.setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
+ case "proxyport":
+ case "proxyPort": target.setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
+ case "proxyscheme":
+ case "proxyScheme": target.setProxyScheme(property(camelContext, java.lang.String.class, value)); return true;
+ case "scheme": target.setScheme(property(camelContext, java.lang.String.class, value)); return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": return java.lang.String.class;
+ case "client": return io.weaviate.client.WeaviateClient.class;
+ case "host": return java.lang.String.class;
+ case "proxyhost":
+ case "proxyHost": return java.lang.String.class;
+ case "proxyport":
+ case "proxyPort": return java.lang.Integer.class;
+ case "proxyscheme":
+ case "proxyScheme": return java.lang.String.class;
+ case "scheme": return java.lang.String.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration target = (org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": return target.getApiKey();
+ case "client": return target.getClient();
+ case "host": return target.getHost();
+ case "proxyhost":
+ case "proxyHost": return target.getProxyHost();
+ case "proxyport":
+ case "proxyPort": return target.getProxyPort();
+ case "proxyscheme":
+ case "proxyScheme": return target.getProxyScheme();
+ case "scheme": return target.getScheme();
+ default: return null;
+ }
+ }
+}
+
diff --git a/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpointConfigurer.java b/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpointConfigurer.java
new file mode 100644
index 00000000000..8f092ec443f
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpointConfigurer.java
@@ -0,0 +1,81 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.weaviate;
+
+import javax.annotation.processing.Generated;
+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!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo")
+@SuppressWarnings("unchecked")
+public class WeaviateVectorDbEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+ WeaviateVectorDbEndpoint target = (WeaviateVectorDbEndpoint) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": target.getConfiguration().setApiKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "host": target.getConfiguration().setHost(property(camelContext, java.lang.String.class, value)); return true;
+ case "lazystartproducer":
+ case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
+ case "proxyhost":
+ case "proxyHost": target.getConfiguration().setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
+ case "proxyport":
+ case "proxyPort": target.getConfiguration().setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
+ case "proxyscheme":
+ case "proxyScheme": target.getConfiguration().setProxyScheme(property(camelContext, java.lang.String.class, value)); return true;
+ case "scheme": target.getConfiguration().setScheme(property(camelContext, java.lang.String.class, value)); return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": return java.lang.String.class;
+ case "host": return java.lang.String.class;
+ case "lazystartproducer":
+ case "lazyStartProducer": return boolean.class;
+ case "proxyhost":
+ case "proxyHost": return java.lang.String.class;
+ case "proxyport":
+ case "proxyPort": return java.lang.Integer.class;
+ case "proxyscheme":
+ case "proxyScheme": return java.lang.String.class;
+ case "scheme": return java.lang.String.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ WeaviateVectorDbEndpoint target = (WeaviateVectorDbEndpoint) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "apikey":
+ case "apiKey": return target.getConfiguration().getApiKey();
+ case "host": return target.getConfiguration().getHost();
+ case "lazystartproducer":
+ case "lazyStartProducer": return target.isLazyStartProducer();
+ case "proxyhost":
+ case "proxyHost": return target.getConfiguration().getProxyHost();
+ case "proxyport":
+ case "proxyPort": return target.getConfiguration().getProxyPort();
+ case "proxyscheme":
+ case "proxyScheme": return target.getConfiguration().getProxyScheme();
+ case "scheme": return target.getConfiguration().getScheme();
+ default: return null;
+ }
+ }
+}
+
diff --git a/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpointUriFactory.java b/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpointUriFactory.java
new file mode 100644
index 00000000000..711878047ab
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpointUriFactory.java
@@ -0,0 +1,79 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.weaviate;
+
+import javax.annotation.processing.Generated;
+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!
+ */
+@Generated("org.apache.camel.maven.packaging.GenerateEndpointUriFactoryMojo")
+public class WeaviateVectorDbEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
+
+ private static final String BASE = ":collection";
+
+ private static final Set<String> PROPERTY_NAMES;
+ private static final Set<String> SECRET_PROPERTY_NAMES;
+ private static final Set<String> MULTI_VALUE_PREFIXES;
+ static {
+ Set<String> props = new HashSet<>(8);
+ props.add("apiKey");
+ props.add("collection");
+ props.add("host");
+ props.add("lazyStartProducer");
+ props.add("proxyHost");
+ props.add("proxyPort");
+ props.add("proxyScheme");
+ props.add("scheme");
+ PROPERTY_NAMES = Collections.unmodifiableSet(props);
+ Set<String> secretProps = new HashSet<>(1);
+ secretProps.add("apiKey");
+ SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps);
+ MULTI_VALUE_PREFIXES = Collections.emptySet();
+ }
+
+ @Override
+ public boolean isEnabled(String scheme) {
+ return "weaviate".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, "collection", 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 Set<String> multiValuePrefixes() {
+ return MULTI_VALUE_PREFIXES;
+ }
+
+ @Override
+ public boolean isLenientProperties() {
+ return false;
+ }
+}
+
diff --git a/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/org/apache/camel/component/weaviate/weaviate.json b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/org/apache/camel/component/weaviate/weaviate.json
new file mode 100644
index 00000000000..074341d67da
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/org/apache/camel/component/weaviate/weaviate.json
@@ -0,0 +1,62 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "weaviate",
+ "title": "weaviate",
+ "description": "Perform operations on the Weaviate Vector Database.",
+ "deprecated": false,
+ "firstVersion": "4.11.0",
+ "label": "database,ai",
+ "javaType": "org.apache.camel.component.weaviate.WeaviateVectorDbComponent",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-weaviate",
+ "version": "4.12.0-SNAPSHOT",
+ "scheme": "weaviate",
+ "extendsScheme": "",
+ "syntax": "weaviate:collection",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": true,
+ "lenientProperties": false,
+ "browsable": false,
+ "remote": true
+ },
+ "componentProperties": {
+ "apiKey": { "index": 0, "kind": "property", "displayName": "Api Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "API Key to authenticate to weaviate with" },
+ "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration;" },
+ "host": { "index": 2, "kind": "property", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Weaviate server host to connect to" },
+ "lazyStartProducer": { "index": 3, "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 [...]
+ "proxyHost": { "index": 4, "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy host to connect to weaviate through" },
+ "proxyPort": { "index": 5, "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy port to connect to weaviate through" },
+ "proxyScheme": { "index": 6, "kind": "property", "displayName": "Proxy Scheme", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy scheme to connect to weaviate through" },
+ "scheme": { "index": 7, "kind": "property", "displayName": "Scheme", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Scheme used to connect to weaviate" },
+ "autowiredEnabled": { "index": 8, "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 [...]
+ },
+ "headers": {
+ "CamelWeaviateAction": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "CREATE_COLLECTION", "CREATE_INDEX", "UPSERT", "INSERT", "SEARCH", "DELETE", "UPDATE", "QUERY", "QUERY_BY_ID" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The action to be performed.", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#ACTION" },
+ "CamelWeaviateTextFieldName": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Text Field Name for Insert\/Upsert operation", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#TEXT_FIELD_NAME" },
+ "CamelweaviateVectorFieldName": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Vector Field Name for Insert\/Upsert operation", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#VECTOR_FIELD_NAME" },
+ "CamelWeaviateCollectionName": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Name for Insert\/Upsert operation", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_NAME" },
+ "CamelWeaviateCollectionSimilarityMetric": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "cosine", "euclidean", "dotproduct" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Similarity Metric", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_SIMILARITY_METRIC" },
+ "CamelWeaviateCollectionDimension": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Dimension", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_DIMENSION" },
+ "CamelWeaviateCollectionCloud": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "aws", "gcp", "azure" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Cloud Vendor", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_CLOUD" },
+ "CamelWeaviateCollectionCloudRegion": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "aws", "gcp", "azure" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Collection Cloud Vendor Region", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#COLLECTION_CLOUD_REGION" },
+ "CamelWeaviateIndexName": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Index Name", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#INDEX_NAME" },
+ "CamelWeaviateFields": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "HashMap", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Weaviate Object fields", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#FIELDS" },
+ "CamelWeaviateProperties": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "HashMap", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Weaviate Object properties", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#PROPERTIES" },
+ "CamelWeaviateIndexId": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Index Id", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#INDEX_ID" },
+ "CamelWeaviateQueryTopK": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query Top K", "constantName": "org.apache.camel.component.weaviate.WeaviateVectorDb$Headers#QUERY_TOP_K" }
+ },
+ "properties": {
+ "collection": { "index": 0, "kind": "path", "displayName": "Collection", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The collection Name" },
+ "apiKey": { "index": 1, "kind": "parameter", "displayName": "Api Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "API Key to authenticate to weaviate with" },
+ "host": { "index": 2, "kind": "parameter", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Weaviate server host to connect to" },
+ "proxyHost": { "index": 3, "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy host to connect to weaviate through" },
+ "proxyPort": { "index": 4, "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy port to connect to weaviate through" },
+ "proxyScheme": { "index": 5, "kind": "parameter", "displayName": "Proxy Scheme", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Proxy scheme to connect to weaviate through" },
+ "scheme": { "index": 6, "kind": "parameter", "displayName": "Scheme", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration", "configurationField": "configuration", "description": "Scheme used to connect to weaviate" },
+ "lazyStartProducer": { "index": 7, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "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 produc [...]
+ }
+}
diff --git a/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/component.properties
new file mode 100644
index 00000000000..3642f4c9cf2
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/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=weaviate
+groupId=org.apache.camel
+artifactId=camel-weaviate
+version=4.12.0-SNAPSHOT
+projectName=Camel :: AI :: Weaviate
+projectDescription=Camel Weaviate support
diff --git a/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/component/weaviate b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/component/weaviate
new file mode 100644
index 00000000000..3d3ffbdbdd3
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/component/weaviate
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.weaviate.WeaviateVectorDbComponent
diff --git a/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration
new file mode 100644
index 00000000000..22d22455d5e
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.weaviate.WeaviateVectorDbConfigurationConfigurer
diff --git a/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/weaviate-component b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/weaviate-component
new file mode 100644
index 00000000000..6920c42bdce
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/weaviate-component
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.weaviate.WeaviateVectorDbComponentConfigurer
diff --git a/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/weaviate-endpoint b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/weaviate-endpoint
new file mode 100644
index 00000000000..ea848cbb893
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/configurer/weaviate-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.weaviate.WeaviateVectorDbEndpointConfigurer
diff --git a/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/urifactory/weaviate-endpoint b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/urifactory/weaviate-endpoint
new file mode 100644
index 00000000000..550a45fb9ba
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/generated/resources/META-INF/services/org/apache/camel/urifactory/weaviate-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.weaviate.WeaviateVectorDbEndpointUriFactory
diff --git a/components/camel-ai/camel-weaviate/src/main/docs/weaviate-component.adoc b/components/camel-ai/camel-weaviate/src/main/docs/weaviate-component.adoc
new file mode 100644
index 00000000000..197bcdc3ccd
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/main/docs/weaviate-component.adoc
@@ -0,0 +1,47 @@
+= weaviate Component
+:doctitle: weaviate
+:shortname: weaviate
+:artifactid: camel-weaviate
+:description: Perform operations on the Weaviate Vector Database.
+:since: 4.11
+:supportlevel: Preview
+:tabs-sync-option:
+:component-header: Only producer is supported
+//Manually maintained attributes
+:group: AI
+:camel-spring-boot-name: weaviate
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The Weaviate Component provides support for interacting with the https://weaviate.io/[weaviate Vector Database].
+
+== URI format
+
+----
+weaviate:collection[?options]
+----
+
+Where *collection* represents a named set of points (vectors with a payload) defined in your database.
+
+
+// component-configure options: START
+
+// component-configure options: END
+
+// component options: START
+include::partial$component-configure-options.adoc[]
+include::partial$component-endpoint-options.adoc[]
+// component options: END
+
+// endpoint options: START
+
+// endpoint options: END
+
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
+
+
+include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDb.java b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDb.java
new file mode 100644
index 00000000000..3b04111e1fd
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDb.java
@@ -0,0 +1,68 @@
+/*
+ * 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.weaviate;
+
+import org.apache.camel.spi.Metadata;
+
+public class WeaviateVectorDb {
+ public static final String SCHEME = "weaviate";
+
+ private WeaviateVectorDb() {
+ }
+
+ public static class Headers {
+ @Metadata(description = "The action to be performed.", javaType = "String",
+ enums = "CREATE_COLLECTION,CREATE_INDEX,UPSERT,INSERT,SEARCH,DELETE,UPDATE,QUERY,QUERY_BY_ID")
+ public static final String ACTION = "CamelWeaviateAction";
+
+ @Metadata(description = "Text Field Name for Insert/Upsert operation", javaType = "String")
+ public static final String TEXT_FIELD_NAME = "CamelWeaviateTextFieldName";
+
+ @Metadata(description = "Vector Field Name for Insert/Upsert operation", javaType = "String")
+ public static final String VECTOR_FIELD_NAME = "CamelweaviateVectorFieldName";
+
+ @Metadata(description = "Collection Name for Insert/Upsert operation", javaType = "String")
+ public static final String COLLECTION_NAME = "CamelWeaviateCollectionName";
+
+ @Metadata(description = "Collection Similarity Metric", javaType = "String", enums = "cosine,euclidean,dotproduct")
+ public static final String COLLECTION_SIMILARITY_METRIC = "CamelWeaviateCollectionSimilarityMetric";
+
+ @Metadata(description = "Collection Dimension", javaType = "int")
+ public static final String COLLECTION_DIMENSION = "CamelWeaviateCollectionDimension";
+
+ @Metadata(description = "Collection Cloud Vendor", javaType = "String", enums = "aws,gcp,azure")
+ public static final String COLLECTION_CLOUD = "CamelWeaviateCollectionCloud";
+
+ @Metadata(description = "Collection Cloud Vendor Region", javaType = "String", enums = "aws,gcp,azure")
+ public static final String COLLECTION_CLOUD_REGION = "CamelWeaviateCollectionCloudRegion";
+
+ @Metadata(description = "Index Name", javaType = "String")
+ public static final String INDEX_NAME = "CamelWeaviateIndexName";
+
+ @Metadata(description = "Weaviate Object fields", javaType = "HashMap")
+ public static final String FIELDS = "CamelWeaviateFields";
+
+ @Metadata(description = "Weaviate Object properties", javaType = "HashMap")
+ public static final String PROPERTIES = "CamelWeaviateProperties";
+
+ @Metadata(description = "Index Id", javaType = "String")
+ public static final String INDEX_ID = "CamelWeaviateIndexId";
+
+ @Metadata(description = "Query Top K", javaType = "Integer")
+ public static final String QUERY_TOP_K = "CamelWeaviateQueryTopK";
+ }
+}
diff --git a/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbAction.java b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbAction.java
new file mode 100644
index 00000000000..fe08e353a5f
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbAction.java
@@ -0,0 +1,27 @@
+/*
+ * 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.weaviate;
+
+public enum WeaviateVectorDbAction {
+ CREATE_COLLECTION,
+ CREATE,
+ DELETE_BY_ID,
+ DELETE_COLLECTION,
+ QUERY,
+ QUERY_BY_ID,
+ UPDATE_BY_ID
+}
diff --git a/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbComponent.java b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbComponent.java
new file mode 100644
index 00000000000..e62e8b886d6
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbComponent.java
@@ -0,0 +1,71 @@
+/*
+ * 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.weaviate;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Component(WeaviateVectorDb.SCHEME)
+public class WeaviateVectorDbComponent extends DefaultComponent {
+ private static final Logger LOGGER = LoggerFactory.getLogger(WeaviateVectorDbComponent.class);
+
+ @Metadata
+ private WeaviateVectorDbConfiguration configuration;
+
+ public WeaviateVectorDbComponent() {
+ this(null);
+ }
+
+ public WeaviateVectorDbComponent(CamelContext context) {
+ super(context);
+
+ this.configuration = new WeaviateVectorDbConfiguration();
+ }
+
+ public WeaviateVectorDbConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ /**
+ * The configuration;
+ */
+ public void setConfiguration(WeaviateVectorDbConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ @Override
+ protected Endpoint createEndpoint(
+ String uri,
+ String remaining,
+ Map<String, Object> parameters)
+ throws Exception {
+
+ WeaviateVectorDbConfiguration configuration = this.configuration.copy();
+
+ WeaviateVectorDbEndpoint endpoint = new WeaviateVectorDbEndpoint(uri, this, remaining, configuration);
+ setProperties(endpoint, parameters);
+
+ return endpoint;
+ }
+}
diff --git a/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbConfiguration.java b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbConfiguration.java
new file mode 100644
index 00000000000..82a04c62f09
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbConfiguration.java
@@ -0,0 +1,183 @@
+/*
+ * 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.weaviate;
+
+import io.weaviate.client.WeaviateClient;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Configurer;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+
+@Configurer
+@UriParams
+public class WeaviateVectorDbConfiguration implements Cloneable {
+
+ @Metadata(label = "producer",
+ description = "Scheme used to connect to weaviate")
+ @UriParam
+ private String scheme;
+
+ @Metadata(label = "producer",
+ description = "Weaviate server host to connect to")
+ @UriParam
+ private String host;
+
+ @Metadata(label = "producer",
+ description = "Proxy host to connect to weaviate through")
+ @UriParam
+ private String proxyHost;
+
+ @Metadata(label = "producer",
+ description = "Proxy port to connect to weaviate through")
+ @UriParam
+ private Integer proxyPort;
+
+ @Metadata(label = "producer",
+ description = "Proxy scheme to connect to weaviate through")
+ @UriParam
+ private String proxyScheme;
+
+ @Metadata(label = "producer",
+ description = "API Key to authenticate to weaviate with", secret = true)
+ @UriParam
+ private String apiKey;
+
+ @Metadata(autowired = true)
+ private WeaviateClient client;
+
+ /*
+ * Get the api key used to authenticate to weaviate server.
+ */
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ /**
+ * Set the api key used to authenticate to weaviate server.
+ */
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ /**
+ * Get the scheme (http/https/etc) used in connecting to weaviate.
+ *
+ * @return scheme
+ */
+ public String getScheme() {
+ return scheme;
+ }
+
+ /*
+ * Set the scheme (http/https/etc) used in connecting to weaviate.
+ */
+ public void setScheme(String scheme) {
+ this.scheme = scheme;
+ }
+
+ /**
+ * Get the weaviate server host.
+ *
+ * @return host
+ */
+ public String getHost() {
+ return host;
+ }
+
+ /*
+ * Set the weaviate server host.
+ */
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ /*
+ * Get the proxy host used for connecting to weaviate.
+ */
+ public String getProxyHost() {
+ return proxyHost;
+ }
+
+ /**
+ * Set the proxy host used to connect to weaviate.
+ *
+ * @param proxyHost proxy host
+ */
+ public void setProxyHost(String proxyHost) {
+ this.proxyHost = proxyHost;
+ }
+
+ /*
+ * Get the proxy port used to connect to weaviate.
+ */
+ public Integer getProxyPort() {
+ return proxyPort;
+ }
+
+ /*
+ * Set the proxy port used to connect to weaviate.
+ */
+ public void setProxyPort(Integer proxyPort) {
+ this.proxyPort = proxyPort;
+ }
+
+ /*
+ * Get the scheme (http/https/etc) used for connecting to proxy.
+ */
+ public String getProxyScheme() {
+ return proxyScheme;
+ }
+
+ /**
+ * Set the scheme used to for connecting to the proxy.
+ *
+ * @param proxyScheme
+ */
+ public void setProxyScheme(String proxyScheme) {
+ this.proxyScheme = proxyScheme;
+ }
+
+ /**
+ * Get the io.weaviate.client.WeaviateClient.
+ */
+ public WeaviateClient getClient() {
+ return client;
+ }
+
+ /**
+ * Set the io.weaviate.client.WeaviateClient used.
+ *
+ * @param client
+ */
+ public void setClient(WeaviateClient client) {
+ this.client = client;
+ }
+
+ // ************************
+ //
+ // Clone
+ //
+ // ************************
+ public WeaviateVectorDbConfiguration copy() {
+ try {
+ return (WeaviateVectorDbConfiguration) super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeCamelException(e);
+ }
+ }
+}
diff --git a/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpoint.java b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpoint.java
new file mode 100644
index 00000000000..da291c130a2
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbEndpoint.java
@@ -0,0 +1,143 @@
+/*
+ * 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.weaviate;
+
+import io.weaviate.client.Config;
+import io.weaviate.client.WeaviateAuthClient;
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.auth.exception.AuthException;
+import org.apache.camel.Category;
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+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.UriParam;
+import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.DefaultEndpoint;
+
+/**
+ * Perform operations on the Weaviate Vector Database.
+ */
+@UriEndpoint(
+ firstVersion = "4.11.0",
+ scheme = WeaviateVectorDb.SCHEME,
+ title = "weaviate",
+ syntax = "weaviate:collection",
+ producerOnly = true,
+ category = {
+ Category.DATABASE,
+ Category.AI
+ },
+ headersClass = WeaviateVectorDb.Headers.class)
+public class WeaviateVectorDbEndpoint extends DefaultEndpoint {
+
+ @Metadata(required = true)
+ @UriPath(description = "The collection Name")
+ private final String collection;
+
+ @UriParam
+ private WeaviateVectorDbConfiguration configuration;
+
+ private WeaviateClient client;
+
+ public WeaviateVectorDbEndpoint(
+ String endpointUri,
+ Component component,
+ String collection,
+ WeaviateVectorDbConfiguration configuration) {
+
+ super(endpointUri, component);
+
+ this.collection = collection;
+ this.configuration = configuration;
+ }
+
+ public WeaviateVectorDbConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public String getCollection() {
+ return collection;
+ }
+
+ public WeaviateClient getClient() throws AuthException {
+ lock.lock();
+ try {
+ if (this.client == null) {
+ this.client = this.configuration.getClient();
+ if (this.client == null) {
+ this.client = createClient();
+ }
+ }
+ return this.client;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ @Override
+ public Producer createProducer() throws Exception {
+ return new WeaviateVectorDbProducer(this);
+ }
+
+ @Override
+ public Consumer createConsumer(Processor processor) throws Exception {
+ throw new UnsupportedOperationException("Consumer is not implemented for this component");
+ }
+
+ @Override
+ public void doStart() throws Exception {
+ super.doStart();
+ }
+
+ @Override
+ public void doStop() throws Exception {
+ super.doStop();
+ }
+
+ private WeaviateClient createClient() throws AuthException {
+ String scheme = configuration.getScheme();
+ String host = configuration.getHost();
+ Config config = new Config(scheme, host);
+
+ // Configure proxy if we have proxy details within the configuration
+ if (configuration.getProxyHost() != null
+ && configuration.getProxyPort() != null
+ && configuration.getProxyScheme() != null) {
+ config.setProxy(configuration.getProxyHost(), configuration.getProxyPort().intValue(),
+ configuration.getProxyScheme());
+ }
+
+ WeaviateClient weaviate;
+
+ if (configuration.getApiKey() != null) {
+ weaviate = WeaviateAuthClient.apiKey(config, configuration.getApiKey());
+ } else {
+ weaviate = new WeaviateClient(config);
+ }
+
+ Result<Boolean> result = weaviate.misc().readyChecker().run();
+ if (result.hasErrors()) {
+ throw new AuthException(result.getError().toString());
+ }
+
+ return weaviate;
+ }
+}
diff --git a/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbProducer.java b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbProducer.java
new file mode 100644
index 00000000000..653beb93981
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/main/java/org/apache/camel/component/weaviate/WeaviateVectorDbProducer.java
@@ -0,0 +1,301 @@
+/*
+ * 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.weaviate;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.data.model.WeaviateObject;
+import io.weaviate.client.v1.graphql.model.GraphQLResponse;
+import io.weaviate.client.v1.graphql.query.argument.NearVectorArgument;
+import io.weaviate.client.v1.graphql.query.builder.GetBuilder;
+import io.weaviate.client.v1.graphql.query.fields.Field;
+import io.weaviate.client.v1.graphql.query.fields.Fields;
+import io.weaviate.client.v1.schema.model.WeaviateClass;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.NoSuchHeaderException;
+import org.apache.camel.support.DefaultProducer;
+import org.apache.camel.support.ExchangeHelper;
+
+public class WeaviateVectorDbProducer extends DefaultProducer {
+ private WeaviateClient client;
+ private ExecutorService executor;
+
+ public WeaviateVectorDbProducer(WeaviateVectorDbEndpoint endpoint) {
+ super(endpoint);
+ }
+
+ @Override
+ public WeaviateVectorDbEndpoint getEndpoint() {
+ return (WeaviateVectorDbEndpoint) super.getEndpoint();
+ }
+
+ @Override
+ public void doStart() throws Exception {
+ super.doStart();
+
+ this.client = getEndpoint().getClient();
+ }
+
+ @Override
+ public void process(Exchange exchange) {
+ final Message in = exchange.getMessage();
+ final WeaviateVectorDbAction action = in.getHeader(WeaviateVectorDb.Headers.ACTION, WeaviateVectorDbAction.class);
+
+ try {
+ if (action == null) {
+ throw new NoSuchHeaderException("The action is a required header", exchange, WeaviateVectorDb.Headers.ACTION);
+ }
+
+ switch (action) {
+ case CREATE_COLLECTION:
+ createCollection(exchange);
+ break;
+ case CREATE:
+ create(exchange);
+ break;
+ case UPDATE_BY_ID:
+ updateById(exchange);
+ break;
+ case DELETE_BY_ID:
+ deleteById(exchange);
+ break;
+ case DELETE_COLLECTION:
+ deleteCollection(exchange);
+ break;
+ case QUERY:
+ query(exchange);
+ break;
+ case QUERY_BY_ID:
+ queryById(exchange);
+ break;
+ default:
+ throw new UnsupportedOperationException("Unsupported action: " + action.name());
+ }
+ } catch (Exception e) {
+ exchange.setException(e);
+ }
+ }
+
+ // ***************************************
+ //
+ // Actions
+ //
+ // ***************************************
+
+ private void createCollection(Exchange exchange) throws Exception {
+ final Message in = exchange.getMessage();
+
+ String collectionName;
+ if (in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class) != null) {
+ collectionName = in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class);
+ } else {
+ collectionName = getEndpoint().getCollection();
+ }
+
+ WeaviateClass collection = WeaviateClass.builder().className(collectionName).build();
+
+ Result<Boolean> res = client.misc().readyChecker().run();
+
+ Result<Boolean> result = client.schema().classCreator().withClass(collection).run();
+ populateResponse(result, exchange);
+
+ }
+
+ private void create(Exchange exchange) throws Exception {
+ final Message in = exchange.getMessage();
+ List elements = in.getMandatoryBody(List.class);
+
+ // Check the headers for a collection name. Use the endpoint's
+ // collection name by default
+ String collectionName;
+ if (in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class) != null) {
+ collectionName = in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class);
+ } else {
+ collectionName = getEndpoint().getCollection();
+ }
+
+ HashMap<String, Object> props = in.getHeader(WeaviateVectorDb.Headers.PROPERTIES, HashMap.class);
+
+ Float[] vectors = (Float[]) elements.toArray(new Float[0]);
+
+ Result<WeaviateObject> result = client.data().creator()
+ .withClassName(collectionName)
+ .withVector(vectors)
+ .withProperties(props)
+ .run();
+
+ populateResponse(result, exchange);
+ }
+
+ private void updateById(Exchange exchange) throws Exception {
+ final Message in = exchange.getMessage();
+ List elements = in.getMandatoryBody(List.class);
+ String indexId = ExchangeHelper.getMandatoryHeader(exchange, WeaviateVectorDb.Headers.INDEX_ID, String.class);
+
+ // Check the headers for a collection name. Use the endpoint's
+ // collection name by default
+ String collectionName;
+ if (in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class) != null) {
+ collectionName = in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class);
+ } else {
+ collectionName = getEndpoint().getCollection();
+ }
+
+ Float[] vectors = (Float[]) elements.toArray(new Float[0]);
+
+ Result<Boolean> result = client.data().updater()
+ .withMerge()
+ .withID(indexId)
+ .withClassName(collectionName)
+ .withVector(vectors)
+ .run();
+
+ populateResponse(result, exchange);
+ }
+
+ private void deleteById(Exchange exchange) throws Exception {
+ final Message in = exchange.getMessage();
+ String indexId = ExchangeHelper.getMandatoryHeader(exchange, WeaviateVectorDb.Headers.INDEX_ID, String.class);
+
+ // Check the headers for a collection name. Use the endpoint's
+ // collection name by default
+ String collectionName;
+ if (in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class) != null) {
+ collectionName = in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class);
+ } else {
+ collectionName = getEndpoint().getCollection();
+ }
+ Result<Boolean> result = this.client.data().deleter()
+ .withClassName(collectionName)
+ .withID(indexId)
+ .run();
+ populateResponse(result, exchange);
+ }
+
+ private void deleteCollection(Exchange exchange) throws Exception {
+ final Message in = exchange.getMessage();
+
+ String collectionName;
+ if (in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class) != null) {
+ collectionName = in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class);
+ } else {
+ collectionName = getEndpoint().getCollection();
+ }
+
+ Result<Boolean> result = this.client.schema().classDeleter()
+ .withClassName(collectionName)
+ .run();
+
+ populateResponse(result, exchange);
+ }
+
+ private void query(Exchange exchange) throws Exception {
+ final Message in = exchange.getMessage();
+ List elements = in.getMandatoryBody(List.class);
+
+ // topK default of 10
+ int topK = 10;
+ if (in.getHeader(WeaviateVectorDb.Headers.QUERY_TOP_K, Integer.class) != null) {
+ topK = in.getHeader(WeaviateVectorDb.Headers.QUERY_TOP_K, Integer.class);
+ }
+
+ // Check the headers for a collection name. Use the endpoint's
+ // collection name by default
+ String collectionName;
+ if (in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class) != null) {
+ collectionName = in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class);
+ } else {
+ collectionName = getEndpoint().getCollection();
+ }
+
+ Float[] vectors = (Float[]) elements.toArray(new Float[0]);
+
+ NearVectorArgument nearVectorArg = NearVectorArgument.builder()
+ .vector(vectors)
+ .build();
+
+ Fields fields;
+
+ if (in.getHeader(WeaviateVectorDb.Headers.FIELDS, HashMap.class) != null) {
+ HashMap<String, Object> fieldToSearch = in.getHeader(WeaviateVectorDb.Headers.FIELDS, HashMap.class);
+
+ List<Field> fieldList = new ArrayList<>();
+ for (String key : fieldToSearch.keySet()) {
+ fieldList.add(Field.builder().name(key).build());
+ }
+ Field[] fieldArray = (Field[]) fieldList.toArray();
+ fields = Fields.builder().fields(fieldArray).build();
+
+ } else {
+ fields = Fields.builder().fields(new Field[0]).build();
+ }
+
+ String query = GetBuilder.builder()
+ .className(collectionName)
+ .fields(fields)
+ .withNearVectorFilter(nearVectorArg)
+ .limit(topK)
+ .build()
+ .buildQuery();
+
+ Result<GraphQLResponse> result = client.graphQL().raw().withQuery(query).run();
+ populateResponse(result, exchange);
+ }
+
+ private void queryById(Exchange exchange) throws Exception {
+ final Message in = exchange.getMessage();
+ String indexId = ExchangeHelper.getMandatoryHeader(exchange, WeaviateVectorDb.Headers.INDEX_ID, String.class);
+
+ // Check the headers for a collection name. Use the endpoint's
+ // collection name by default
+ String collectionName;
+ if (in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class) != null) {
+ collectionName = in.getHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, String.class);
+ } else {
+ collectionName = getEndpoint().getCollection();
+ }
+
+ Result<List<WeaviateObject>> result = client.data().objectsGetter()
+ .withClassName(collectionName)
+ .withID(indexId)
+ .run();
+
+ populateResponse(result, exchange);
+ }
+
+ // ***************************************
+ //
+ // Helpers
+ //
+ // ***************************************
+
+ private CamelContext getCamelContext() {
+ return getEndpoint().getCamelContext();
+ }
+
+ private void populateResponse(Result<?> r, Exchange exchange) {
+ Message out = exchange.getMessage();
+ out.setBody(r);
+ }
+}
diff --git a/components/camel-ai/camel-weaviate/src/test/java/org/apache/camel/component/weaviate/WeaviateComponentConfigurationTest.java b/components/camel-ai/camel-weaviate/src/test/java/org/apache/camel/component/weaviate/WeaviateComponentConfigurationTest.java
new file mode 100644
index 00000000000..fccb324a5d6
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/test/java/org/apache/camel/component/weaviate/WeaviateComponentConfigurationTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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.weaviate;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.camel.test.junit5.TestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class WeaviateComponentConfigurationTest extends CamelTestSupport {
+
+ public Properties loadWeaviatePropertiesFile() throws IOException {
+ final String fileName = "weaviate.properties";
+ return TestSupport.loadExternalProperties(WeaviateComponentConfigurationTest.class.getClassLoader(), fileName);
+ }
+
+ @Test
+ void createEndpointWithMinimalConfiguration() throws Exception {
+ WeaviateVectorDbComponent component = context.getComponent("weaviate", WeaviateVectorDbComponent.class);
+ WeaviateVectorDbEndpoint endpoint = (WeaviateVectorDbEndpoint) component
+ .createEndpoint(
+ "weaviate://test-collection?host=localhost:7979&scheme=http&proxyHost=localhost&proxyPort=7777&proxyScheme=https&apiKey=foobar123");
+ assertEquals("localhost:7979", endpoint.getConfiguration().getHost());
+ assertEquals("http", endpoint.getConfiguration().getScheme());
+ assertEquals("localhost", endpoint.getConfiguration().getProxyHost());
+ assertEquals(7777, endpoint.getConfiguration().getProxyPort());
+ assertEquals("https", endpoint.getConfiguration().getProxyScheme());
+ assertEquals("foobar123", endpoint.getConfiguration().getApiKey());
+ }
+
+ @Test
+ void createEndpointWithProperties() throws Exception {
+ Properties properties = loadWeaviatePropertiesFile();
+ Map<String, Object> propsMap = (Map) properties;
+
+ WeaviateVectorDbComponent component = context.getComponent("weaviate", WeaviateVectorDbComponent.class);
+ WeaviateVectorDbEndpoint endpoint = (WeaviateVectorDbEndpoint) component
+ .createEndpoint(
+ "weaviate://test-collection", "", propsMap);
+ assertEquals("bighost:7878", endpoint.getConfiguration().getHost());
+ assertEquals("ftp", endpoint.getConfiguration().getScheme());
+ assertEquals("littlehost", endpoint.getConfiguration().getProxyHost());
+ assertEquals(8888, endpoint.getConfiguration().getProxyPort());
+ assertEquals("ftps", endpoint.getConfiguration().getProxyScheme());
+ assertEquals("barfoo123", endpoint.getConfiguration().getApiKey());
+ }
+
+}
diff --git a/components/camel-ai/camel-weaviate/src/test/java/org/apache/camel/component/weaviate/it/WeaviateComponentIT.java b/components/camel-ai/camel-weaviate/src/test/java/org/apache/camel/component/weaviate/it/WeaviateComponentIT.java
new file mode 100644
index 00000000000..046cfd8b396
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/test/java/org/apache/camel/component/weaviate/it/WeaviateComponentIT.java
@@ -0,0 +1,206 @@
+/*
+ * 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.weaviate.it;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.data.model.WeaviateObject;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.weaviate.WeaviateVectorDb;
+import org.apache.camel.component.weaviate.WeaviateVectorDbAction;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperties;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+// Must be manually tested. Provide your own accessKey and secretKey using -Dweaviate.token
+// Example :
+// mvn -Dweaviate.apikey=YOURAPIKEY -Dweaviate.host=YOURHOST -Dweaviate.scheme=https verify
+
+@EnabledIfSystemProperties({
+ @EnabledIfSystemProperty(named = "weaviate.apikey", matches = ".*", disabledReason = "weaviate API Key not provided"),
+})
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+public class WeaviateComponentIT extends CamelTestSupport {
+
+ private static final String COLLECTION = "WeaviateComponentITCollection";
+ private static String CREATEID = null;
+
+ @Test
+ @Order(1)
+ public void createCollection() {
+
+ Exchange result = fluentTemplate
+ .to("weaviate:test-collection?scheme={{weaviate.scheme}}&host={{weaviate.host}}&apiKey={{weaviate.apikey}}")
+ .withHeader(WeaviateVectorDb.Headers.ACTION, WeaviateVectorDbAction.CREATE_COLLECTION)
+ .withHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, COLLECTION)
+ .request(Exchange.class);
+
+ assertThat(result).isNotNull();
+ Result<Boolean> res = (Result<Boolean>) result.getIn().getBody();
+ assertThat(!res.hasErrors());
+ assertThat(res.getResult() == true);
+ assertThat(result.getException()).isNull();
+ }
+
+ @Test
+ @Order(2)
+ public void create() {
+
+ List<Float> elements = Arrays.asList(1.0f, 2.0f, 3.0f);
+
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("sky", "blue");
+ map.put("age", "34");
+
+ Exchange result = fluentTemplate.to(
+ "weaviate:test-collection?scheme=https&host=ifugnkxslq42gscwfi1lg.c0.us-east1.gcp.weaviate.cloud&apiKey={{weaviate.apikey}}")
+ .withHeader(WeaviateVectorDb.Headers.ACTION, WeaviateVectorDbAction.CREATE)
+ .withBody(elements)
+ .withHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, COLLECTION)
+ .withHeader(WeaviateVectorDb.Headers.PROPERTIES, map)
+ .request(Exchange.class);
+
+ assertThat(result).isNotNull();
+
+ Result<WeaviateObject> res = (Result<WeaviateObject>) result.getIn().getBody();
+ CREATEID = res.getResult().getId();
+
+ assertThat(!res.hasErrors());
+ assertThat(res != null);
+ }
+
+ @Test
+ @Order(7)
+ public void queryById() {
+
+ Exchange result = fluentTemplate.to(
+ "weaviate:test-collection?scheme=https&host=ifugnkxslq42gscwfi1lg.c0.us-east1.gcp.weaviate.cloud&apiKey={{weaviate.apikey}}")
+ .withHeader(WeaviateVectorDb.Headers.ACTION, WeaviateVectorDbAction.QUERY_BY_ID)
+ .withHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, COLLECTION)
+ .withHeader(WeaviateVectorDb.Headers.INDEX_ID, CREATEID)
+ .request(Exchange.class);
+
+ assertThat(result).isNotNull();
+ assertThat(result.getException()).isNull();
+ Result<WeaviateObject> res = (Result<WeaviateObject>) result.getIn().getBody();
+ assertThat(!res.hasErrors());
+
+ List<WeaviateObject> list = (List) res.getResult();
+ for (WeaviateObject wo : list) {
+
+ Map<String, Object> map = wo.getProperties();
+ assertThat(map.containsKey("sky"));
+ assertThat(map.containsKey("age"));
+ }
+
+ }
+
+ @Test
+ @Order(7)
+ public void updateById() {
+
+ List<Float> elements = Arrays.asList(1.0f, 2.0f, 3.0f);
+
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("dog", "dachshund");
+
+ Exchange result = fluentTemplate.to(
+ "weaviate:test-collection?scheme=https&host=ifugnkxslq42gscwfi1lg.c0.us-east1.gcp.weaviate.cloud&apiKey={{weaviate.apikey}}")
+ .withHeader(WeaviateVectorDb.Headers.ACTION, WeaviateVectorDbAction.UPDATE_BY_ID)
+ .withBody(elements)
+ .withHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, COLLECTION)
+ .withHeader(WeaviateVectorDb.Headers.PROPERTIES, map)
+ .request(Exchange.class);
+
+ assertThat(result).isNotNull();
+
+ assertThat(result).isNotNull();
+ Result<Boolean> res = (Result<Boolean>) result.getIn().getBody();
+ assertThat(!res.hasErrors());
+ assertThat(res.getResult() == true);
+ assertThat(result.getException()).isNull();
+ }
+
+ @Test
+ @Order(8)
+ public void queryByVector() {
+
+ List<Float> elements = Arrays.asList(1.0f, 2.0f, 3.2f);
+
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("sky", "blue");
+
+ Exchange result = fluentTemplate.to(
+ "weaviate:test-collection?scheme=https&host=ifugnkxslq42gscwfi1lg.c0.us-east1.gcp.weaviate.cloud&apiKey={{weaviate.apikey}}")
+ .withHeader(WeaviateVectorDb.Headers.ACTION, WeaviateVectorDbAction.QUERY)
+ .withBody(
+ elements)
+ .withHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, COLLECTION)
+ .withHeader(WeaviateVectorDb.Headers.QUERY_TOP_K, 20)
+ .withHeader(WeaviateVectorDb.Headers.FIELDS, map)
+ .request(Exchange.class);
+
+ assertThat(result).isNotNull();
+ List<Float> vector = (List<Float>) result.getIn().getBody();
+ assertThat(vector.get(0) == 1.0f);
+ assertThat(vector.get(1) == 2.0f);
+ assertThat(vector.get(2) == 3.0f);
+ }
+
+ @Test
+ @Order(9)
+ public void deleteById() {
+
+ Exchange result = fluentTemplate.to(
+ "weaviate:test-collection?scheme=https&host=ifugnkxslq42gscwfi1lg.c0.us-east1.gcp.weaviate.cloud&apiKey={{weaviate.apikey}}")
+ .withHeader(WeaviateVectorDb.Headers.ACTION, WeaviateVectorDbAction.DELETE_BY_ID)
+ .withHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, COLLECTION)
+ .withHeader(WeaviateVectorDb.Headers.INDEX_ID, CREATEID)
+ .request(Exchange.class);
+
+ assertThat(result).isNotNull();
+ Result<Boolean> res = (Result<Boolean>) result.getIn().getBody();
+
+ assertThat(!res.hasErrors());
+ assertThat(res.getResult() == true);
+ assertThat(result.getException()).isNull();
+ }
+
+ @Test
+ @Order(10)
+ public void deleteCollection() {
+ Exchange result = fluentTemplate
+ .to("weaviate:test-collection?scheme=https&host=ifugnkxslq42gscwfi1lg.c0.us-east1.gcp.weaviate.cloud&apiKey={{weaviate.apikey}}")
+ .withHeader(WeaviateVectorDb.Headers.ACTION, WeaviateVectorDbAction.DELETE_COLLECTION)
+ .withHeader(WeaviateVectorDb.Headers.COLLECTION_NAME, COLLECTION)
+ .request(Exchange.class);
+
+ assertThat(result).isNotNull();
+ Result<Boolean> res = (Result<Boolean>) result.getIn().getBody();
+ assertThat(!res.hasErrors());
+ assertThat(res.getResult() == true);
+ assertThat(result.getException()).isNull();
+ }
+
+}
diff --git a/components/camel-ai/camel-weaviate/src/test/resources/log4j2.properties b/components/camel-ai/camel-weaviate/src/test/resources/log4j2.properties
new file mode 100644
index 00000000000..015ea955dd3
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/test/resources/log4j2.properties
@@ -0,0 +1,35 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-weaviate-test.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
+
+rootLogger.level = INFO
+rootLogger.appenderRef.file.ref = file
+# To log to stdout
+#rootLogger.appenderRef.out.ref = out
+
+logger.camel-weaviate.name = org.apache.camel.component.weaviate
+logger.camel-weaviate.level = DEBUG
diff --git a/components/camel-ai/camel-weaviate/src/test/resources/weaviate.properties b/components/camel-ai/camel-weaviate/src/test/resources/weaviate.properties
new file mode 100644
index 00000000000..c0591a83859
--- /dev/null
+++ b/components/camel-ai/camel-weaviate/src/test/resources/weaviate.properties
@@ -0,0 +1,22 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+host=bighost:7878
+scheme=ftp
+proxyHost=littlehost
+proxyPort=8888
+proxyScheme=ftps
+apiKey=barfoo123
\ No newline at end of file
diff --git a/components/camel-ai/pom.xml b/components/camel-ai/pom.xml
index 2c51fac3578..8c8c4b479ae 100644
--- a/components/camel-ai/pom.xml
+++ b/components/camel-ai/pom.xml
@@ -49,6 +49,7 @@
<module>camel-qdrant</module>
<module>camel-tensorflow-serving</module>
<module>camel-torchserve</module>
+ <module>camel-weaviate</module>
</modules>
</project>
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 56de12b7e38..f289e17861d 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
@@ -338,6 +338,7 @@ vertx-http
vertx-websocket
wasm
weather
+weaviate
web3j
webhook
whatsapp
diff --git a/docs/components/modules/ROOT/examples/json/weaviate.json b/docs/components/modules/ROOT/examples/json/weaviate.json
new file mode 120000
index 00000000000..85da8512a2d
--- /dev/null
+++ b/docs/components/modules/ROOT/examples/json/weaviate.json
@@ -0,0 +1 @@
+../../../../../../components/camel-ai/camel-weaviate/src/generated/resources/META-INF/org/apache/camel/component/weaviate/weaviate.json
\ No newline at end of file
diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index 8e48c1a194e..83d7e778596 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -18,6 +18,7 @@
*** xref:qdrant-component.adoc[Qdrant]
*** xref:tensorflow-serving-component.adoc[TensorFlow Serving]
*** xref:torchserve-component.adoc[TorchServe]
+*** xref:weaviate-component.adoc[weaviate]
** xref:amqp-component.adoc[AMQP]
** xref:arangodb-component.adoc[ArangoDb]
** xref:as2-component.adoc[AS2]
diff --git a/docs/components/modules/ROOT/pages/weaviate-component.adoc b/docs/components/modules/ROOT/pages/weaviate-component.adoc
new file mode 120000
index 00000000000..2ab59d2e0eb
--- /dev/null
+++ b/docs/components/modules/ROOT/pages/weaviate-component.adoc
@@ -0,0 +1 @@
+../../../../../components/camel-ai/camel-weaviate/src/main/docs/weaviate-component.adoc
\ No newline at end of file
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 f9dda1c3672..b29066fea5b 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
@@ -4562,6 +4562,19 @@ public interface ComponentsBuilderFactory {
static WeatherComponentBuilderFactory.WeatherComponentBuilder weather() {
return WeatherComponentBuilderFactory.weather();
}
+ /**
+ * weaviate (camel-weaviate)
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Category: database,ai
+ * Since: 4.11
+ * Maven coordinates: org.apache.camel:camel-weaviate
+ *
+ * @return the dsl builder
+ */
+ static WeaviateComponentBuilderFactory.WeaviateComponentBuilder weaviate() {
+ return WeaviateComponentBuilderFactory.weaviate();
+ }
/**
* Web3j Ethereum Blockchain (camel-web3j)
* Interact with Ethereum nodes using web3j client API.
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/WeaviateComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/WeaviateComponentBuilderFactory.java
new file mode 100644
index 00000000000..af405f1bbfb
--- /dev/null
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/WeaviateComponentBuilderFactory.java
@@ -0,0 +1,239 @@
+/* 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.weaviate.WeaviateVectorDbComponent;
+
+/**
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
+public interface WeaviateComponentBuilderFactory {
+
+ /**
+ * weaviate (camel-weaviate)
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Category: database,ai
+ * Since: 4.11
+ * Maven coordinates: org.apache.camel:camel-weaviate
+ *
+ * @return the dsl builder
+ */
+ static WeaviateComponentBuilder weaviate() {
+ return new WeaviateComponentBuilderImpl();
+ }
+
+ /**
+ * Builder for the weaviate component.
+ */
+ interface WeaviateComponentBuilder extends ComponentBuilder<WeaviateVectorDbComponent> {
+
+ /**
+ * API Key to authenticate to weaviate with.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param apiKey the value to set
+ * @return the dsl builder
+ */
+ default WeaviateComponentBuilder apiKey(java.lang.String apiKey) {
+ doSetProperty("apiKey", apiKey);
+ return this;
+ }
+
+ /**
+ * The configuration;.
+ *
+ * The option is a:
+ * <code>org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration</code> type.
+ *
+ * Group: producer
+ *
+ * @param configuration the value to set
+ * @return the dsl builder
+ */
+ default WeaviateComponentBuilder configuration(org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration configuration) {
+ doSetProperty("configuration", configuration);
+ return this;
+ }
+
+ /**
+ * Weaviate server host to connect to.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param host the value to set
+ * @return the dsl builder
+ */
+ default WeaviateComponentBuilder host(java.lang.String host) {
+ doSetProperty("host", host);
+ 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 WeaviateComponentBuilder lazyStartProducer(boolean lazyStartProducer) {
+ doSetProperty("lazyStartProducer", lazyStartProducer);
+ return this;
+ }
+
+ /**
+ * Proxy host to connect to weaviate through.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param proxyHost the value to set
+ * @return the dsl builder
+ */
+ default WeaviateComponentBuilder proxyHost(java.lang.String proxyHost) {
+ doSetProperty("proxyHost", proxyHost);
+ return this;
+ }
+
+ /**
+ * Proxy port to connect to weaviate through.
+ *
+ * The option is a: <code>java.lang.Integer</code> type.
+ *
+ * Group: producer
+ *
+ * @param proxyPort the value to set
+ * @return the dsl builder
+ */
+ default WeaviateComponentBuilder proxyPort(java.lang.Integer proxyPort) {
+ doSetProperty("proxyPort", proxyPort);
+ return this;
+ }
+
+ /**
+ * Proxy scheme to connect to weaviate through.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param proxyScheme the value to set
+ * @return the dsl builder
+ */
+ default WeaviateComponentBuilder proxyScheme(java.lang.String proxyScheme) {
+ doSetProperty("proxyScheme", proxyScheme);
+ return this;
+ }
+
+ /**
+ * Scheme used to connect to weaviate.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param scheme the value to set
+ * @return the dsl builder
+ */
+ default WeaviateComponentBuilder scheme(java.lang.String scheme) {
+ doSetProperty("scheme", scheme);
+ 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 WeaviateComponentBuilder autowiredEnabled(boolean autowiredEnabled) {
+ doSetProperty("autowiredEnabled", autowiredEnabled);
+ return this;
+ }
+ }
+
+ class WeaviateComponentBuilderImpl
+ extends AbstractComponentBuilder<WeaviateVectorDbComponent>
+ implements WeaviateComponentBuilder {
+ @Override
+ protected WeaviateVectorDbComponent buildConcreteComponent() {
+ return new WeaviateVectorDbComponent();
+ }
+ private org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration getOrCreateConfiguration(WeaviateVectorDbComponent component) {
+ if (component.getConfiguration() == null) {
+ component.setConfiguration(new org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration());
+ }
+ return component.getConfiguration();
+ }
+ @Override
+ protected boolean setPropertyOnComponent(
+ Component component,
+ String name,
+ Object value) {
+ switch (name) {
+ case "apiKey": getOrCreateConfiguration((WeaviateVectorDbComponent) component).setApiKey((java.lang.String) value); return true;
+ case "configuration": ((WeaviateVectorDbComponent) component).setConfiguration((org.apache.camel.component.weaviate.WeaviateVectorDbConfiguration) value); return true;
+ case "host": getOrCreateConfiguration((WeaviateVectorDbComponent) component).setHost((java.lang.String) value); return true;
+ case "lazyStartProducer": ((WeaviateVectorDbComponent) component).setLazyStartProducer((boolean) value); return true;
+ case "proxyHost": getOrCreateConfiguration((WeaviateVectorDbComponent) component).setProxyHost((java.lang.String) value); return true;
+ case "proxyPort": getOrCreateConfiguration((WeaviateVectorDbComponent) component).setProxyPort((java.lang.Integer) value); return true;
+ case "proxyScheme": getOrCreateConfiguration((WeaviateVectorDbComponent) component).setProxyScheme((java.lang.String) value); return true;
+ case "scheme": getOrCreateConfiguration((WeaviateVectorDbComponent) component).setScheme((java.lang.String) value); return true;
+ case "autowiredEnabled": ((WeaviateVectorDbComponent) component).setAutowiredEnabled((boolean) value); return true;
+ default: return false;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
index 06502a37bd0..505350028a7 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
@@ -358,6 +358,7 @@ public interface EndpointBuilderFactory
org.apache.camel.builder.endpoint.dsl.VertxWebsocketEndpointBuilderFactory.VertxWebsocketBuilders,
org.apache.camel.builder.endpoint.dsl.WasmEndpointBuilderFactory.WasmBuilders,
org.apache.camel.builder.endpoint.dsl.WeatherEndpointBuilderFactory.WeatherBuilders,
+ org.apache.camel.builder.endpoint.dsl.WeaviateVectorDbEndpointBuilderFactory.WeaviateVectorDbBuilders,
org.apache.camel.builder.endpoint.dsl.Web3jEndpointBuilderFactory.Web3jBuilders,
org.apache.camel.builder.endpoint.dsl.WebhookEndpointBuilderFactory.WebhookBuilders,
org.apache.camel.builder.endpoint.dsl.WhatsAppEndpointBuilderFactory.WhatsAppBuilders,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
index 1c851da5032..e5fd8a3f2b7 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
@@ -355,6 +355,7 @@ public interface EndpointBuilders
org.apache.camel.builder.endpoint.dsl.VertxWebsocketEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.WasmEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.WeatherEndpointBuilderFactory,
+ org.apache.camel.builder.endpoint.dsl.WeaviateVectorDbEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.Web3jEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.WebhookEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.WhatsAppEndpointBuilderFactory,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index fac618a91e2..7ef015c73d0 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -15437,6 +15437,46 @@ public class StaticEndpointBuilders {
public static WeatherEndpointBuilderFactory.WeatherEndpointBuilder weather(String componentName, String path) {
return WeatherEndpointBuilderFactory.endpointBuilder(componentName, path);
}
+ /**
+ * weaviate (camel-weaviate)
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Category: database,ai
+ * Since: 4.11
+ * Maven coordinates: org.apache.camel:camel-weaviate
+ *
+ * Syntax: <code>weaviate:collection</code>
+ *
+ * Path parameter: collection (required)
+ * The collection Name
+ *
+ * @param path collection
+ * @return the dsl builder
+ */
+ public static WeaviateVectorDbEndpointBuilderFactory.WeaviateVectorDbEndpointBuilder weaviate(String path) {
+ return weaviate("weaviate", path);
+ }
+ /**
+ * weaviate (camel-weaviate)
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Category: database,ai
+ * Since: 4.11
+ * Maven coordinates: org.apache.camel:camel-weaviate
+ *
+ * Syntax: <code>weaviate:collection</code>
+ *
+ * Path parameter: collection (required)
+ * The collection Name
+ *
+ * @param componentName to use a custom component name for the endpoint
+ * instead of the default name
+ * @param path collection
+ * @return the dsl builder
+ */
+ public static WeaviateVectorDbEndpointBuilderFactory.WeaviateVectorDbEndpointBuilder weaviate(String componentName, String path) {
+ return WeaviateVectorDbEndpointBuilderFactory.endpointBuilder(componentName, path);
+ }
/**
* Web3j Ethereum Blockchain (camel-web3j)
* Interact with Ethereum nodes using web3j client API.
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WeaviateVectorDbEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WeaviateVectorDbEndpointBuilderFactory.java
new file mode 100644
index 00000000000..81fb9aa6fc9
--- /dev/null
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WeaviateVectorDbEndpointBuilderFactory.java
@@ -0,0 +1,438 @@
+/* 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.endpoint.dsl;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.function.*;
+import java.util.stream.*;
+import javax.annotation.processing.Generated;
+import org.apache.camel.builder.EndpointConsumerBuilder;
+import org.apache.camel.builder.EndpointProducerBuilder;
+import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
+
+/**
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
+public interface WeaviateVectorDbEndpointBuilderFactory {
+
+ /**
+ * Builder for endpoint for the weaviate component.
+ */
+ public interface WeaviateVectorDbEndpointBuilder
+ extends
+ EndpointProducerBuilder {
+ default AdvancedWeaviateVectorDbEndpointBuilder advanced() {
+ return (AdvancedWeaviateVectorDbEndpointBuilder) this;
+ }
+
+ /**
+ * API Key to authenticate to weaviate with.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param apiKey the value to set
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder apiKey(String apiKey) {
+ doSetProperty("apiKey", apiKey);
+ return this;
+ }
+ /**
+ * Weaviate server host to connect to.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param host the value to set
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder host(String host) {
+ doSetProperty("host", host);
+ return this;
+ }
+ /**
+ * Proxy host to connect to weaviate through.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param proxyHost the value to set
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder proxyHost(String proxyHost) {
+ doSetProperty("proxyHost", proxyHost);
+ return this;
+ }
+ /**
+ * Proxy port to connect to weaviate through.
+ *
+ * The option is a: <code>java.lang.Integer</code> type.
+ *
+ * Group: producer
+ *
+ * @param proxyPort the value to set
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder proxyPort(Integer proxyPort) {
+ doSetProperty("proxyPort", proxyPort);
+ return this;
+ }
+ /**
+ * Proxy port to connect to weaviate through.
+ *
+ * The option will be converted to a <code>java.lang.Integer</code>
+ * type.
+ *
+ * Group: producer
+ *
+ * @param proxyPort the value to set
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder proxyPort(String proxyPort) {
+ doSetProperty("proxyPort", proxyPort);
+ return this;
+ }
+ /**
+ * Proxy scheme to connect to weaviate through.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param proxyScheme the value to set
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder proxyScheme(String proxyScheme) {
+ doSetProperty("proxyScheme", proxyScheme);
+ return this;
+ }
+ /**
+ * Scheme used to connect to weaviate.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param scheme the value to set
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder scheme(String scheme) {
+ doSetProperty("scheme", scheme);
+ return this;
+ }
+ }
+
+ /**
+ * Advanced builder for endpoint for the weaviate component.
+ */
+ public interface AdvancedWeaviateVectorDbEndpointBuilder
+ extends
+ EndpointProducerBuilder {
+ default WeaviateVectorDbEndpointBuilder basic() {
+ return (WeaviateVectorDbEndpointBuilder) 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 (advanced)
+ *
+ * @param lazyStartProducer the value to set
+ * @return the dsl builder
+ */
+ default AdvancedWeaviateVectorDbEndpointBuilder 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 (advanced)
+ *
+ * @param lazyStartProducer the value to set
+ * @return the dsl builder
+ */
+ default AdvancedWeaviateVectorDbEndpointBuilder lazyStartProducer(String lazyStartProducer) {
+ doSetProperty("lazyStartProducer", lazyStartProducer);
+ return this;
+ }
+ }
+
+ public interface WeaviateVectorDbBuilders {
+ /**
+ * weaviate (camel-weaviate)
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Category: database,ai
+ * Since: 4.11
+ * Maven coordinates: org.apache.camel:camel-weaviate
+ *
+ * @return the dsl builder for the headers' name.
+ */
+ default WeaviateVectorDbHeaderNameBuilder weaviate() {
+ return WeaviateVectorDbHeaderNameBuilder.INSTANCE;
+ }
+ /**
+ * weaviate (camel-weaviate)
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Category: database,ai
+ * Since: 4.11
+ * Maven coordinates: org.apache.camel:camel-weaviate
+ *
+ * Syntax: <code>weaviate:collection</code>
+ *
+ * Path parameter: collection (required)
+ * The collection Name
+ *
+ * @param path collection
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder weaviate(String path) {
+ return WeaviateVectorDbEndpointBuilderFactory.endpointBuilder("weaviate", path);
+ }
+ /**
+ * weaviate (camel-weaviate)
+ * Perform operations on the Weaviate Vector Database.
+ *
+ * Category: database,ai
+ * Since: 4.11
+ * Maven coordinates: org.apache.camel:camel-weaviate
+ *
+ * Syntax: <code>weaviate:collection</code>
+ *
+ * Path parameter: collection (required)
+ * The collection Name
+ *
+ * @param componentName to use a custom component name for the endpoint
+ * instead of the default name
+ * @param path collection
+ * @return the dsl builder
+ */
+ default WeaviateVectorDbEndpointBuilder weaviate(String componentName, String path) {
+ return WeaviateVectorDbEndpointBuilderFactory.endpointBuilder(componentName, path);
+ }
+
+ }
+ /**
+ * The builder of headers' name for the weaviate component.
+ */
+ public static class WeaviateVectorDbHeaderNameBuilder {
+ /**
+ * The internal instance of the builder used to access to all the
+ * methods representing the name of headers.
+ */
+ private static final WeaviateVectorDbHeaderNameBuilder INSTANCE = new WeaviateVectorDbHeaderNameBuilder();
+
+ /**
+ * The action to be performed.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateAction}.
+ */
+ public String weaviateAction() {
+ return "CamelWeaviateAction";
+ }
+ /**
+ * Text Field Name for Insert/Upsert operation.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateTextFieldName}.
+ */
+ public String weaviateTextFieldName() {
+ return "CamelWeaviateTextFieldName";
+ }
+ /**
+ * Vector Field Name for Insert/Upsert operation.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code weaviateVectorFieldName}.
+ */
+ public String weaviateVectorFieldName() {
+ return "CamelweaviateVectorFieldName";
+ }
+ /**
+ * Collection Name for Insert/Upsert operation.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateCollectionName}.
+ */
+ public String weaviateCollectionName() {
+ return "CamelWeaviateCollectionName";
+ }
+ /**
+ * Collection Similarity Metric.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code
+ * WeaviateCollectionSimilarityMetric}.
+ */
+ public String weaviateCollectionSimilarityMetric() {
+ return "CamelWeaviateCollectionSimilarityMetric";
+ }
+ /**
+ * Collection Dimension.
+ *
+ * The option is a: {@code int} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateCollectionDimension}.
+ */
+ public String weaviateCollectionDimension() {
+ return "CamelWeaviateCollectionDimension";
+ }
+ /**
+ * Collection Cloud Vendor.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateCollectionCloud}.
+ */
+ public String weaviateCollectionCloud() {
+ return "CamelWeaviateCollectionCloud";
+ }
+ /**
+ * Collection Cloud Vendor Region.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateCollectionCloudRegion}.
+ */
+ public String weaviateCollectionCloudRegion() {
+ return "CamelWeaviateCollectionCloudRegion";
+ }
+ /**
+ * Index Name.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateIndexName}.
+ */
+ public String weaviateIndexName() {
+ return "CamelWeaviateIndexName";
+ }
+ /**
+ * Weaviate Object fields.
+ *
+ * The option is a: {@code HashMap} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateFields}.
+ */
+ public String weaviateFields() {
+ return "CamelWeaviateFields";
+ }
+ /**
+ * Weaviate Object properties.
+ *
+ * The option is a: {@code HashMap} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateProperties}.
+ */
+ public String weaviateProperties() {
+ return "CamelWeaviateProperties";
+ }
+ /**
+ * Index Id.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateIndexId}.
+ */
+ public String weaviateIndexId() {
+ return "CamelWeaviateIndexId";
+ }
+ /**
+ * Query Top K.
+ *
+ * The option is a: {@code Integer} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code WeaviateQueryTopK}.
+ */
+ public String weaviateQueryTopK() {
+ return "CamelWeaviateQueryTopK";
+ }
+ }
+ static WeaviateVectorDbEndpointBuilder endpointBuilder(String componentName, String path) {
+ class WeaviateVectorDbEndpointBuilderImpl extends AbstractEndpointBuilder implements WeaviateVectorDbEndpointBuilder, AdvancedWeaviateVectorDbEndpointBuilder {
+ public WeaviateVectorDbEndpointBuilderImpl(String path) {
+ super(componentName, path);
+ }
+ }
+ return new WeaviateVectorDbEndpointBuilderImpl(path);
+ }
+}
\ No newline at end of file
diff --git a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
index 86cc1b51e3d..bf9f07cf78f 100644
--- a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
+++ b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
@@ -343,6 +343,7 @@ org.apache.camel.component.vertx.http.VertxHttpComponent=camel:vertx-http
org.apache.camel.component.vertx.websocket.VertxWebsocketComponent=camel:vertx-websocket
org.apache.camel.component.wasm.WasmComponent=camel:wasm
org.apache.camel.component.weather.WeatherComponent=camel:weather
+org.apache.camel.component.weaviate.WeaviateVectorDbComponent=camel:weaviate
org.apache.camel.component.web3j.Web3jComponent=camel:web3j
org.apache.camel.component.webhook.WebhookComponent=camel:webhook
org.apache.camel.component.whatsapp.WhatsAppComponent=camel:whatsapp
diff --git a/parent/pom.xml b/parent/pom.xml
index 0f5d60b107d..721b3cdd50c 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -502,6 +502,7 @@
<velocity-version>2.4.1</velocity-version>
<vertx-version>4.5.13</vertx-version>
<vysper-version>0.7</vysper-version>
+ <weaviate-client-version>4.7.0</weaviate-client-version>
<web3j-version>5.0.0</web3j-version>
<web3j-quorum-version>4.10.0</web3j-quorum-version>
<wildfly-elytron>2.2.2.Final</wildfly-elytron>
@@ -2609,6 +2610,11 @@
<artifactId>camel-weather</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-weaviate</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-web3j</artifactId>
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java
index 80910745a9e..79087f88846 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java
@@ -43,7 +43,8 @@ public final class MojoHelper {
dir.resolve("camel-langchain4j-tools"), dir.resolve("camel-langchain4j-web-search"),
dir.resolve("camel-qdrant"), dir.resolve("camel-milvus"), dir.resolve("camel-neo4j"),
dir.resolve("camel-pinecone"), dir.resolve("camel-kserve"),
- dir.resolve("camel-torchserve"), dir.resolve("camel-tensorflow-serving"));
+ dir.resolve("camel-torchserve"), dir.resolve("camel-tensorflow-serving"),
+ dir.resolve("camel-weaviate"));
case "camel-as2":
return Collections.singletonList(dir.resolve("camel-as2-component"));
case "camel-avro-rpc":