You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "smongiar (via GitHub)" <gi...@apache.org> on 2026/03/04 16:37:36 UTC
[PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
smongiar opened a new pull request, #21705:
URL: https://github.com/apache/camel/pull/21705
# Description
Need to collect processors and beans for more comfortable usage in route DSL definitions. Some changes involve JBang as well to make it work with camel CLI
# Target
- [ X] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
- [ X] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
<!--
You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
-->
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on code in PR #21705:
URL: https://github.com/apache/camel/pull/21705#discussion_r2889634086
##########
components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGCreateCollection.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.qdrant.rag;
+
+import io.qdrant.client.grpc.Collections;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.qdrant.QdrantAction;
+import org.apache.camel.component.qdrant.QdrantHeaders;
+
+public class RAGCreateCollection implements Processor {
+
+ private String size = "768";
+ private String distance = "Cosine";
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ int vectorSize = Integer.parseInt(size);
+
+ Collections.Distance distanceEnum = switch (distance.toLowerCase()) {
+ case "cosine" -> Collections.Distance.Cosine;
+ case "euclid" -> Collections.Distance.Euclid;
+ case "dot" -> Collections.Distance.Dot;
+ case "manhattan" -> Collections.Distance.Manhattan;
+ default -> throw new IllegalArgumentException(
+ "Unknown distance metric: " + distance + ". Supported values: Cosine, Euclid, Dot, Manhattan");
+ };
Review Comment:
What about using RAGCreateCollection.valueOf()?
It would allow to work with new unit of distance if added later in the library
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #21705:
URL: https://github.com/apache/camel/pull/21705#issuecomment-4006469502
please separate this and create a new JIRA about camel-jbang
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on PR #21705:
URL: https://github.com/apache/camel/pull/21705#issuecomment-4006361638
> I do not understand the link between the commit message and all the modifications.
>
> the different modifications that would worth different commits/PR) that I understood are:
>
> * In the component, a parameter has been added for max results
Sure not mentioned in commit message, but useful to limit results during a vectorial search. I implemented an example that make use of it
> * some changes in jbang to look to src/main/resources for application.properties
Exactly. It was not mentioned in commit message, but it's in the PR description. Basically I tried to export a Qdrant example app with SB and Quarkus. Something like:
```camel export --runtime=quarkus --gav=org.apache.camel.example:qdrant-rag-quarkus:1.0.0 --directory=./export-quarkus src/main/resources/camel/qdrant-rag.camel.yaml```
I faced some issues, so I need to enforce application.properties check to avoid maven fallback
> * specific Qdrant Processors
That's mentioned in commit message
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on code in PR #21705:
URL: https://github.com/apache/camel/pull/21705#discussion_r2894418648
##########
components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGCreateCollection.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.qdrant.rag;
+
+import io.qdrant.client.grpc.Collections;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.qdrant.QdrantAction;
+import org.apache.camel.component.qdrant.QdrantHeaders;
+
+public class RAGCreateCollection implements Processor {
+
+ private String size = "768";
+ private String distance = "Cosine";
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ int vectorSize = Integer.parseInt(size);
+
+ Collections.Distance distanceEnum = switch (distance.toLowerCase()) {
+ case "cosine" -> Collections.Distance.Cosine;
+ case "euclid" -> Collections.Distance.Euclid;
+ case "dot" -> Collections.Distance.Dot;
+ case "manhattan" -> Collections.Distance.Manhattan;
+ default -> throw new IllegalArgumentException(
+ "Unknown distance metric: " + distance + ". Supported values: Cosine, Euclid, Dot, Manhattan");
+ };
Review Comment:
Yes, [it](https://github.com/apache/camel/pull/21705/changes#diff-c6a016294da5182cffce13432f83f6e243e3b32659a4d567bc6f2a367f7aca0eR34) is
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #21705:
URL: https://github.com/apache/camel/pull/21705
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #21705:
URL: https://github.com/apache/camel/pull/21705#discussion_r2894386125
##########
components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGCreateCollection.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.qdrant.rag;
+
+import io.qdrant.client.grpc.Collections;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.qdrant.QdrantAction;
+import org.apache.camel.component.qdrant.QdrantHeaders;
+
+public class RAGCreateCollection implements Processor {
+
+ private String size = "768";
+ private String distance = "Cosine";
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ int vectorSize = Integer.parseInt(size);
+
+ Collections.Distance distanceEnum = switch (distance.toLowerCase()) {
+ case "cosine" -> Collections.Distance.Cosine;
+ case "euclid" -> Collections.Distance.Euclid;
+ case "dot" -> Collections.Distance.Dot;
+ case "manhattan" -> Collections.Distance.Manhattan;
+ default -> throw new IllegalArgumentException(
+ "Unknown distance metric: " + distance + ". Supported values: Cosine, Euclid, Dot, Manhattan");
+ };
Review Comment:
Was this resolved ?
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on code in PR #21705:
URL: https://github.com/apache/camel/pull/21705#discussion_r2891291658
##########
components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGCreateCollection.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.qdrant.rag;
+
+import io.qdrant.client.grpc.Collections;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.qdrant.QdrantAction;
+import org.apache.camel.component.qdrant.QdrantHeaders;
+
+public class RAGCreateCollection implements Processor {
+
+ private String size = "768";
+ private String distance = "Cosine";
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ int vectorSize = Integer.parseInt(size);
+
+ Collections.Distance distanceEnum = switch (distance.toLowerCase()) {
+ case "cosine" -> Collections.Distance.Cosine;
+ case "euclid" -> Collections.Distance.Euclid;
+ case "dot" -> Collections.Distance.Dot;
+ case "manhattan" -> Collections.Distance.Manhattan;
+ default -> throw new IllegalArgumentException(
+ "Unknown distance metric: " + distance + ". Supported values: Cosine, Euclid, Dot, Manhattan");
+ };
Review Comment:
that's a good point. I wrongly assumed it's immutable. Let me try this. Thank you.
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #21705:
URL: https://github.com/apache/camel/pull/21705#issuecomment-3999564027
There are uncommitted changes
HEAD detached at pull/21705/merge
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/qdrant.json
modified: dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QdrantEndpointBuilderFactory.java
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #21705:
URL: https://github.com/apache/camel/pull/21705#issuecomment-4004957909
There are uncommitted changes
HEAD detached at pull/21705/merge
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/qdrant.json
modified: dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QdrantEndpointBuilderFactory.java
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Camel-Qdrant: collect processors to be used as ref beans [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21705:
URL: https://github.com/apache/camel/pull/21705#issuecomment-3999119168
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org