aldettinger commented on code in PR #13109:
URL: https://github.com/apache/camel/pull/13109#discussion_r1492450105


##########
components/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantEndpoint.java:
##########
@@ -0,0 +1,150 @@
+/*
+ * 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.qdrant;
+
+import io.grpc.ManagedChannel;
+import io.grpc.ManagedChannelBuilder;
+import io.qdrant.client.QdrantClient;
+import io.qdrant.client.QdrantGrpcClient;
+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 Qdrant Vector Database.
+ */
+@UriEndpoint(
+             firstVersion = "4.5.0",
+             scheme = Qdrant.SCHEME,
+             title = "Qdrant",
+             syntax = "qdrant:collection",
+             producerOnly = true,
+             category = {
+                     Category.DATABASE,
+                     Category.AI
+             },
+             headersClass = Qdrant.Headers.class)
+public class QdrantEndpoint extends DefaultEndpoint {
+
+    @Metadata(required = true)
+    @UriPath(description = "The collection Name")
+    private final String collection;
+
+    @UriParam
+    private QdrantConfiguration configuration;
+
+    private final Object lock;
+
+    private volatile boolean closeClient;
+    private volatile QdrantClient client;
+
+    public QdrantEndpoint(
+                          String endpointUri,
+                          Component component,
+                          String collection,
+                          QdrantConfiguration configuration) {
+
+        super(endpointUri, component);
+
+        this.collection = collection;
+        this.configuration = configuration;
+
+        this.lock = new Object();
+    }
+
+    public QdrantConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    public String getCollection() {
+        return collection;
+    }
+
+    public synchronized QdrantClient getClient() {
+        if (this.client == null) {
+            synchronized (this.lock) {
+                if (this.client == null) {
+                    this.client = this.configuration.getClient();
+                    this.closeClient = false;
+
+                    if (this.client == null) {
+                        this.client = createClient();
+                        this.closeClient = true;
+                    }
+                }
+            }
+        }
+
+        return this.client;
+    }
+
+    @Override
+    public Producer createProducer() throws Exception {
+        return new QdrantProducer(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.doStart();

Review Comment:
   Might be doStop() ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to