This is an automated email from the ASF dual-hosted git repository.
gnodet 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 196598ca903b Remove usage of deprecated methods withFieldType in
milvus component (#24500)
196598ca903b is described below
commit 196598ca903b66a64bd8c964d7ac58a85b0d4743
Author: Aurélien Pupier <[email protected]>
AuthorDate: Tue Jul 7 18:42:21 2026 +0200
Remove usage of deprecated methods withFieldType in milvus component
(#24500)
Remove usage of deprecated methods withFieldType in milvus component
Migrates MilvusHelperCreateCollection from deprecated
CreateCollectionParam.Builder.addFieldType() to the new
CollectionSchemaParam.Builder pattern, consistent with commit acc2b2af.
---
.../milvus/helpers/MilvusHelperCreateCollection.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git
a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateCollection.java
b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateCollection.java
index 19f81db37008..63b50aca839f 100644
---
a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateCollection.java
+++
b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateCollection.java
@@ -17,6 +17,7 @@
package org.apache.camel.component.milvus.helpers;
import io.milvus.grpc.DataType;
+import io.milvus.param.collection.CollectionSchemaParam;
import io.milvus.param.collection.CreateCollectionParam;
import io.milvus.param.collection.FieldType;
import org.apache.camel.Exchange;
@@ -72,9 +73,10 @@ public class MilvusHelperCreateCollection implements
Processor {
CreateCollectionParam.Builder builder =
CreateCollectionParam.newBuilder()
.withCollectionName(collectionName)
- .withDescription(collectionDescription)
- .addFieldType(idField)
- .addFieldType(textField);
+ .withDescription(collectionDescription);
+
+ CollectionSchemaParam.Builder schemaParamBuilder =
CollectionSchemaParam.newBuilder();
+ schemaParamBuilder.addFieldType(idField).addFieldType(textField);
if (additionalTextFields != null && !additionalTextFields.isBlank()) {
for (String fieldName : additionalTextFields.split(",")) {
@@ -85,12 +87,13 @@ public class MilvusHelperCreateCollection implements
Processor {
.withDataType(DataType.VarChar)
.withMaxLength(maxLength)
.build();
- builder.addFieldType(extraField);
+ schemaParamBuilder.addFieldType(extraField);
}
}
}
- builder.addFieldType(vectorField);
+ schemaParamBuilder.addFieldType(vectorField);
+ builder.withSchema(schemaParamBuilder.build());
exchange.getIn().setBody(builder.build());
exchange.getIn().setHeader(MilvusHeaders.ACTION,
MilvusAction.CREATE_COLLECTION);