You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2024/04/04 11:24:12 UTC
(camel-quarkus) 02/02: Promote Qdrant extension to native #5815
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit a9b6a21353341b2ec28779fd7912044a15ecede3
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Apr 3 15:55:36 2024 +0200
Promote Qdrant extension to native #5815
---
docs/modules/ROOT/examples/components/qdrant.yml | 6 +-
.../ROOT/pages/reference/extensions/qdrant.adoc | 14 ++-
extensions-jvm/pom.xml | 1 -
extensions/pom.xml | 1 +
.../qdrant/deployment/pom.xml | 19 +++-
.../qdrant/deployment/QdrantProcessor.java | 14 ---
{extensions-jvm => extensions}/qdrant/pom.xml | 2 +-
.../qdrant/runtime/pom.xml | 23 +++-
.../main/resources/META-INF/quarkus-extension.yaml | 3 +-
integration-tests-jvm/pom.xml | 1 -
.../component/qdrant/it/QdrantResource.java | 50 ---------
integration-tests/pom.xml | 1 +
.../qdrant/pom.xml | 58 +++++++++-
.../component/qdrant/it/QdrantResource.java | 118 +++++++++++++++++++++
.../quarkus/component/qdrant/it/QdrantIT.java | 24 +++++
.../quarkus/component/qdrant/it/QdrantTest.java | 56 ++++++++++
.../component/qdrant/it/QdrantTestResource.java | 73 +++++++++++++
pom.xml | 1 +
tooling/scripts/test-categories.yaml | 1 +
19 files changed, 382 insertions(+), 84 deletions(-)
diff --git a/docs/modules/ROOT/examples/components/qdrant.yml b/docs/modules/ROOT/examples/components/qdrant.yml
index 0887a47046..6b3a7016de 100644
--- a/docs/modules/ROOT/examples/components/qdrant.yml
+++ b/docs/modules/ROOT/examples/components/qdrant.yml
@@ -2,11 +2,11 @@
# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
cqArtifactId: camel-quarkus-qdrant
cqArtifactIdBase: qdrant
-cqNativeSupported: false
-cqStatus: Preview
+cqNativeSupported: true
+cqStatus: Stable
cqDeprecated: false
cqJvmSince: 3.10.0
-cqNativeSince: n/a
+cqNativeSince: 3.10.0
cqCamelPartName: qdrant
cqCamelPartTitle: Qdrant
cqCamelPartDescription: Perform operations on the Qdrant Vector Database.
diff --git a/docs/modules/ROOT/pages/reference/extensions/qdrant.adoc b/docs/modules/ROOT/pages/reference/extensions/qdrant.adoc
index 549ddc6cfb..a2712d4b11 100644
--- a/docs/modules/ROOT/pages/reference/extensions/qdrant.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/qdrant.adoc
@@ -4,17 +4,17 @@
= Qdrant
:linkattrs:
:cq-artifact-id: camel-quarkus-qdrant
-:cq-native-supported: false
-:cq-status: Preview
-:cq-status-deprecation: Preview
+:cq-native-supported: true
+:cq-status: Stable
+:cq-status-deprecation: Stable
:cq-description: Perform operations on the Qdrant Vector Database.
:cq-deprecated: false
:cq-jvm-since: 3.10.0
-:cq-native-since: n/a
+:cq-native-since: 3.10.0
ifeval::[{doc-show-badges} == true]
[.badges]
-[.badge-key]##JVM since##[.badge-supported]##3.10.0## [.badge-key]##Native##[.badge-unsupported]##unsupported##
+[.badge-key]##JVM since##[.badge-supported]##3.10.0## [.badge-key]##Native since##[.badge-supported]##3.10.0##
endif::[]
Perform operations on the Qdrant Vector Database.
@@ -29,6 +29,10 @@ Please refer to the above link for usage and configuration details.
[id="extensions-qdrant-maven-coordinates"]
== Maven coordinates
+https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-qdrant[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]
+
+Or add the coordinates to your existing project:
+
[source,xml]
----
<dependency>
diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml
index 94eaf452ae..8e16b04c66 100644
--- a/extensions-jvm/pom.xml
+++ b/extensions-jvm/pom.xml
@@ -85,7 +85,6 @@
<module>opensearch</module>
<module>printer</module>
<module>pulsar</module>
- <module>qdrant</module>
<module>quickfix</module>
<module>redis</module>
<module>robotframework</module>
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 2d9db9e730..c107834b6a 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -204,6 +204,7 @@
<module>platform-http</module>
<module>protobuf</module>
<module>pubnub</module>
+ <module>qdrant</module>
<module>quartz</module>
<module>qute</module>
<module>reactive-streams</module>
diff --git a/extensions-jvm/qdrant/deployment/pom.xml b/extensions/qdrant/deployment/pom.xml
similarity index 76%
rename from extensions-jvm/qdrant/deployment/pom.xml
rename to extensions/qdrant/deployment/pom.xml
index a84753ed29..de4c45e831 100644
--- a/extensions-jvm/qdrant/deployment/pom.xml
+++ b/extensions/qdrant/deployment/pom.xml
@@ -18,8 +18,8 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
@@ -36,12 +36,25 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-grpc-common-deployment</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.checkerframework</groupId>
+ <artifactId>checker-qual</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-qdrant</artifactId>
</dependency>
</dependencies>
-
<build>
<plugins>
<plugin>
diff --git a/extensions-jvm/qdrant/deployment/src/main/java/org/apache/camel/quarkus/component/qdrant/deployment/QdrantProcessor.java b/extensions/qdrant/deployment/src/main/java/org/apache/camel/quarkus/component/qdrant/deployment/QdrantProcessor.java
similarity index 67%
rename from extensions-jvm/qdrant/deployment/src/main/java/org/apache/camel/quarkus/component/qdrant/deployment/QdrantProcessor.java
rename to extensions/qdrant/deployment/src/main/java/org/apache/camel/quarkus/component/qdrant/deployment/QdrantProcessor.java
index 7c14a9c465..f54188a0d3 100644
--- a/extensions-jvm/qdrant/deployment/src/main/java/org/apache/camel/quarkus/component/qdrant/deployment/QdrantProcessor.java
+++ b/extensions/qdrant/deployment/src/main/java/org/apache/camel/quarkus/component/qdrant/deployment/QdrantProcessor.java
@@ -17,11 +17,7 @@
package org.apache.camel.quarkus.component.qdrant.deployment;
import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.annotations.ExecutionTime;
-import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.FeatureBuildItem;
-import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild;
-import org.apache.camel.quarkus.core.JvmOnlyRecorder;
import org.jboss.logging.Logger;
class QdrantProcessor {
@@ -33,14 +29,4 @@ class QdrantProcessor {
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}
-
- /**
- * Remove this once this extension starts supporting the native mode.
- */
- @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
- @Record(value = ExecutionTime.RUNTIME_INIT)
- void warnJvmInNative(JvmOnlyRecorder recorder) {
- JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
- recorder.warnJvmInNative(FEATURE); // warn at runtime
- }
}
diff --git a/extensions-jvm/qdrant/pom.xml b/extensions/qdrant/pom.xml
similarity index 96%
rename from extensions-jvm/qdrant/pom.xml
rename to extensions/qdrant/pom.xml
index a81093602e..ccaac32487 100644
--- a/extensions-jvm/qdrant/pom.xml
+++ b/extensions/qdrant/pom.xml
@@ -23,7 +23,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-extensions-jvm</artifactId>
+ <artifactId>camel-quarkus-extensions</artifactId>
<version>3.10.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/extensions-jvm/qdrant/runtime/pom.xml b/extensions/qdrant/runtime/pom.xml
similarity index 79%
rename from extensions-jvm/qdrant/runtime/pom.xml
rename to extensions/qdrant/runtime/pom.xml
index 12ca1f91c7..67f6155e3c 100644
--- a/extensions-jvm/qdrant/runtime/pom.xml
+++ b/extensions/qdrant/runtime/pom.xml
@@ -18,8 +18,8 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
@@ -34,9 +34,20 @@
<properties>
<camel.quarkus.jvmSince>3.10.0</camel.quarkus.jvmSince>
+ <camel.quarkus.nativeSince>3.10.0</camel.quarkus.nativeSince>
</properties>
<dependencies>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-grpc-common</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
@@ -45,6 +56,14 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-qdrant</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.logmanager</groupId>
+ <artifactId>log4j2-jboss-logmanager</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logmanager</groupId>
+ <artifactId>log4j-jboss-logmanager</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/extensions-jvm/qdrant/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/qdrant/runtime/src/main/resources/META-INF/quarkus-extension.yaml
similarity index 97%
rename from extensions-jvm/qdrant/runtime/src/main/resources/META-INF/quarkus-extension.yaml
rename to extensions/qdrant/runtime/src/main/resources/META-INF/quarkus-extension.yaml
index 0d917bde84..307177e841 100644
--- a/extensions-jvm/qdrant/runtime/src/main/resources/META-INF/quarkus-extension.yaml
+++ b/extensions/qdrant/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -25,9 +25,8 @@ name: "Camel Qdrant"
description: "Perform operations on the Qdrant Vector Database"
metadata:
icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg"
- unlisted: true
guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/qdrant.html"
categories:
- "integration"
status:
- - "preview"
+ - "stable"
diff --git a/integration-tests-jvm/pom.xml b/integration-tests-jvm/pom.xml
index 99442a6204..7505895d0b 100644
--- a/integration-tests-jvm/pom.xml
+++ b/integration-tests-jvm/pom.xml
@@ -84,7 +84,6 @@
<module>opensearch</module>
<module>printer</module>
<module>pulsar</module>
- <module>qdrant</module>
<module>quickfix</module>
<module>redis</module>
<module>robotframework</module>
diff --git a/integration-tests-jvm/qdrant/src/main/java/org/apache/camel/quarkus/component/qdrant/it/QdrantResource.java b/integration-tests-jvm/qdrant/src/main/java/org/apache/camel/quarkus/component/qdrant/it/QdrantResource.java
deleted file mode 100644
index b06fcc93cb..0000000000
--- a/integration-tests-jvm/qdrant/src/main/java/org/apache/camel/quarkus/component/qdrant/it/QdrantResource.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.quarkus.component.qdrant.it;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.core.Response;
-import org.apache.camel.CamelContext;
-import org.jboss.logging.Logger;
-
-@Path("/qdrant")
-@ApplicationScoped
-public class QdrantResource {
-
- private static final Logger LOG = Logger.getLogger(QdrantResource.class);
-
- private static final String COMPONENT_QDRANT = "qdrant";
- @Inject
- CamelContext context;
-
- @Path("/load/component/qdrant")
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- public Response loadComponentQdrant() throws Exception {
- /* This is an autogenerated test */
- if (context.getComponent(COMPONENT_QDRANT) != null) {
- return Response.ok().build();
- }
- LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_QDRANT);
- return Response.status(500, COMPONENT_QDRANT + " could not be loaded from the Camel context").build();
- }
-}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 396a4db14b..a8d58ef5de 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -194,6 +194,7 @@
<module>platform-http-proxy-ssl</module>
<module>protobuf</module>
<module>pubnub</module>
+ <module>qdrant</module>
<module>quartz</module>
<module>quartz-clustered</module>
<module>qute</module>
diff --git a/integration-tests-jvm/qdrant/pom.xml b/integration-tests/qdrant/pom.xml
similarity index 61%
rename from integration-tests-jvm/qdrant/pom.xml
rename to integration-tests/qdrant/pom.xml
index bdd182f05b..bfc3d09c05 100644
--- a/integration-tests-jvm/qdrant/pom.xml
+++ b/integration-tests/qdrant/pom.xml
@@ -18,8 +18,8 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
@@ -53,6 +53,22 @@
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>qdrant</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit4-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
@@ -80,5 +96,43 @@
</dependency>
</dependencies>
</profile>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
</profiles>
</project>
diff --git a/integration-tests/qdrant/src/main/java/org/apache/camel/quarkus/component/qdrant/it/QdrantResource.java b/integration-tests/qdrant/src/main/java/org/apache/camel/quarkus/component/qdrant/it/QdrantResource.java
new file mode 100644
index 0000000000..73c3027dcc
--- /dev/null
+++ b/integration-tests/qdrant/src/main/java/org/apache/camel/quarkus/component/qdrant/it/QdrantResource.java
@@ -0,0 +1,118 @@
+/*
+ * 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.quarkus.component.qdrant.it;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import io.qdrant.client.ConditionFactory;
+import io.qdrant.client.PointIdFactory;
+import io.qdrant.client.ValueFactory;
+import io.qdrant.client.VectorsFactory;
+import io.qdrant.client.grpc.Collections;
+import io.qdrant.client.grpc.Points;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import org.apache.camel.Exchange;
+import org.apache.camel.FluentProducerTemplate;
+import org.apache.camel.component.qdrant.Qdrant;
+import org.apache.camel.component.qdrant.QdrantAction;
+
+@Path("/qdrant")
+@ApplicationScoped
+public class QdrantResource {
+
+ @Inject
+ FluentProducerTemplate producer;
+
+ @Path("/createCollection")
+ @PUT
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response createCollection() {
+
+ producer.to("qdrant:testCollection")
+ .withHeader(Qdrant.Headers.ACTION, QdrantAction.CREATE_COLLECTION)
+ .withBody(
+ Collections.VectorParams.newBuilder()
+ .setSize(2)
+ .setDistance(Collections.Distance.Cosine).build())
+ .request();
+
+ return Response.ok().build();
+ }
+
+ @Path("/upsert")
+ @PUT
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response upsert() {
+
+ producer.to("qdrant:testCollection")
+ .withHeader(Qdrant.Headers.ACTION, QdrantAction.UPSERT)
+ .withBody(
+ Points.PointStruct.newBuilder()
+ .setId(PointIdFactory.id(8))
+ .setVectors(VectorsFactory.vectors(List.of(3.5f, 4.5f)))
+ .putAllPayload(Map.of(
+ "foo", ValueFactory.value("hello"),
+ "bar", ValueFactory.value(1)))
+ .build())
+ .request();
+
+ return Response.ok().build();
+ }
+
+ @Path("/retrieve")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response retrieve() {
+
+ Exchange exchange = producer.to("qdrant:testCollection")
+ .withHeader(Qdrant.Headers.ACTION, QdrantAction.RETRIEVE)
+ .withBody(PointIdFactory.id(8))
+ .request(Exchange.class);
+
+ Collection<?> retrieved = exchange.getIn().getBody(Collection.class);
+ String classes = retrieved.stream().map(e -> e.getClass().getName()).distinct().collect(Collectors.joining("/"));
+ return Response.ok(Integer.toString(retrieved.size()) + "/" + classes).build();
+ }
+
+ @Path("/delete")
+ @DELETE
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response delete() {
+
+ Exchange exchange = producer.to("qdrant:testCollection")
+ .withHeader(Qdrant.Headers.ACTION, QdrantAction.DELETE)
+ .withBody(ConditionFactory.matchKeyword("foo", "hello"))
+ .request(Exchange.class);
+
+ Object operationId = exchange.getIn().getHeader(Qdrant.Headers.OPERATION_ID);
+ Object opeartionStatus = exchange.getIn().getHeader(Qdrant.Headers.OPERATION_STATUS);
+ Object operationValue = exchange.getIn().getHeader(Qdrant.Headers.OPERATION_STATUS_VALUE);
+
+ return Response.ok(operationId + "/" + opeartionStatus + "/" + operationValue).build();
+ }
+}
diff --git a/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantIT.java b/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantIT.java
new file mode 100644
index 0000000000..2d1edbe1aa
--- /dev/null
+++ b/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantIT.java
@@ -0,0 +1,24 @@
+/*
+ * 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.quarkus.component.qdrant.it;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+class QdrantIT extends QdrantTest {
+
+}
diff --git a/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantTest.java b/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantTest.java
new file mode 100644
index 0000000000..093d3b395e
--- /dev/null
+++ b/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.quarkus.component.qdrant.it;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.Matchers.is;
+
+@QuarkusTestResource(QdrantTestResource.class)
+@QuarkusTest
+class QdrantTest {
+
+ @Test
+ public void createUpsertRetrieveAndDeleteShouldSucceed() {
+ RestAssured.put("/qdrant/createCollection")
+ .then()
+ .statusCode(200);
+
+ RestAssured.put("/qdrant/upsert")
+ .then()
+ .statusCode(200);
+
+ RestAssured.get("/qdrant/retrieve")
+ .then()
+ .statusCode(200)
+ .body(is("1/io.qdrant.client.grpc.Points$RetrievedPoint"));
+
+ RestAssured.delete("/qdrant/delete")
+ .then()
+ .statusCode(200)
+ .body(is("1/Completed/2"));
+
+ RestAssured.get("/qdrant/retrieve")
+ .then()
+ .statusCode(200)
+ .body(is("0/"));
+ }
+
+}
diff --git a/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantTestResource.java b/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantTestResource.java
new file mode 100644
index 0000000000..6d1b2f2650
--- /dev/null
+++ b/integration-tests/qdrant/src/test/java/org/apache/camel/quarkus/component/qdrant/it/QdrantTestResource.java
@@ -0,0 +1,73 @@
+/*
+ * 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.quarkus.component.qdrant.it;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.qdrant.QdrantContainer;
+import org.testcontainers.utility.DockerImageName;
+import org.testcontainers.utility.TestcontainersConfiguration;
+
+public class QdrantTestResource implements QuarkusTestResourceLifecycleManager {
+
+ private static final Logger LOG = LoggerFactory.getLogger(QdrantTestResource.class);
+ private static final String QDRANT_IMAGE = ConfigProvider.getConfig().getValue("qdrant.container.image", String.class);
+ private static final int QDRANT_GRPC_PORT = 6334;
+
+ private GenericContainer<?> qdrantContainer;
+
+ @Override
+ public Map<String, String> start() {
+ LOG.info(TestcontainersConfiguration.getInstance().toString());
+
+ Map<String, String> properties = new HashMap<>();
+
+ DockerImageName qdrantImageName = DockerImageName.parse(QDRANT_IMAGE).asCompatibleSubstituteFor("qdrant/qdrant");
+ GenericContainer<?> container = new QdrantContainer(qdrantImageName)
+ .withLogConsumer(new Slf4jLogConsumer(LOG));
+ container.start();
+
+ String grpcHost = container.getHost();
+ Integer grpcPort = container.getMappedPort(QDRANT_GRPC_PORT);
+
+ properties.put("camel.component.qdrant.host", grpcHost);
+ properties.put("camel.component.qdrant.port", grpcPort.toString());
+
+ LOG.info("Properties: {}", properties);
+
+ return properties;
+ }
+
+ @Override
+ public void stop() {
+ try {
+ if (qdrantContainer != null) {
+ qdrantContainer.stop();
+ }
+ } catch (Exception ex) {
+ LOG.error("An issue occurred while stopping Qdrant container", ex);
+ }
+ }
+
+}
diff --git a/pom.xml b/pom.xml
index 7e06ba50a5..d5635aba27 100644
--- a/pom.xml
+++ b/pom.xml
@@ -244,6 +244,7 @@
<openssh-server.container.image>docker.io/linuxserver/openssh-server:version-9.3_p2-r0</openssh-server.container.image>
<postgres.container.image>docker.io/postgres:15.0</postgres.container.image>
<postgres-debezium.container.image>docker.io/debezium/postgres:15-alpine</postgres-debezium.container.image>
+ <qdrant.container.image>docker.io/qdrant/qdrant:v1.8.4-unprivileged</qdrant.container.image>
<rabbitmq.container.image>docker.io/rabbitmq:3.9.29-management-alpine</rabbitmq.container.image>
<redis.container.image>docker.io/redis:7.0.12</redis.container.image>
<smb.container.image>quay.io/jamesnetherton/camel-smb-test-server:1.0.0</smb.container.image>
diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index f414b48114..6f132a95f8 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -18,6 +18,7 @@
# Association of test categories and integration test modules. Used by GitHub workflows. Keep sorted alphabetically.
group-01:
- caffeine
+ - qdrant
- git
- google-storage
- hazelcast