Skip to content

CAMEL-23482: Upgrade Weaviate client from v5 to v6#24405

Open
JiriOndrusek wants to merge 1 commit into
apache:mainfrom
JiriOndrusek:fix/CAMEL-23482
Open

CAMEL-23482: Upgrade Weaviate client from v5 to v6#24405
JiriOndrusek wants to merge 1 commit into
apache:mainfrom
JiriOndrusek:fix/CAMEL-23482

Conversation

@JiriOndrusek

Copy link
Copy Markdown
Contributor

Summary

  • Migrate camel-weaviate from io.weaviate:client 5.x to io.weaviate:client6 6.2.1
  • Update upgrade guide with all migration notes (scheme default, PascalCase collections, response types, readiness check removal, proxy deprecation)

Test plan

  • Unit tests pass (WeaviateComponentConfigurationTest — 2 tests)
  • Integration tests pass (WeaviateContainerIT — 7 tests via Testcontainers)
  • Langchain4j embeddings IT (LangChain4jEmbeddingsComponentWeaviateTargetIT — 5 tests)
  • CI green on all platforms

Claude Code on behalf of Jiri Ondrusek

🤖 Generated with Claude Code

Migrate camel-weaviate from io.weaviate:client 5.x to
io.weaviate:client6 6.2.1. This changes the client API
from v5 Result<T> wrappers to direct v6 types, adds gRPC
connection support required by the v6 client, deprecates
proxy configuration (unsupported in v6), and fixes the
autowired client lifecycle to follow the Milvus/Qdrant
closeClient pattern.

Co-Authored-By: Otavio Rodolfo Piske <angusyoung@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JiriOndrusek JiriOndrusek requested review from davsclaus and oscerd July 3, 2026 12:04
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 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 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 have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-ai/camel-langchain4j-embeddings
  • components/camel-ai/camel-weaviate
  • docs
  • dsl/camel-componentdsl
  • dsl/camel-endpointdsl
  • parent
  • test-infra/camel-test-infra-weaviate

POM dependency changes: targeted tests included

Changed properties: weaviate-client-version

Modules affected by dependency changes (1)
  • :camel-weaviate

🔬 Scalpel shadow comparison — Scalpel: 17 tested, 25 compile-only — current: 13 all tested

Maveniverse Scalpel detected 42 affected modules (current approach: 13).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Changed properties: weaviate-client-version

Skip-tests mode would test 17 modules (7 direct + 10 downstream), skip tests for 25 (generated code, meta-modules)

Modules Scalpel would test (17)
  • camel-catalog
  • camel-componentdsl
  • camel-endpointdsl
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-langchain4j-embeddings
  • camel-langchain4j-embeddingstore
  • camel-launcher-container
  • camel-test-infra-all
  • camel-test-infra-weaviate
  • camel-weaviate
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
  • docs
Modules with tests skipped (25)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-csimple-maven-plugin
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (42 modules)
  • Camel :: AI :: LangChain4j :: Embedding
  • Camel :: AI :: LangChain4j :: EmbeddingStore
  • Camel :: AI :: Weaviate
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: Test Infra :: All test services
  • Camel :: Test Infra :: Weaviate
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this migration! The upgrade from Weaviate client v5 to v6 is well-executed with comprehensive documentation. A few observations:

Minor observations:

  1. grpcPort field not initialized with default value — The scheme field follows the pattern private String scheme = "http" with both a field initializer and @UriParam(defaultValue = "http"). But grpcPort only has @UriParam(defaultValue = "50051") without private Integer grpcPort = 50051. If someone calls getGrpcPort() on the configuration directly, they get null even though the documented default is 50051. The null is handled in createClient(), so this works at runtime, but the inconsistency could confuse users of the configuration API.

  2. Endpoint URI uses lowercase test-collection in testsWeaviateContainerIT.getUri() still returns weaviate:test-collection (lowercase) while the upgrade guide states Weaviate v6 requires PascalCase collection names. This works because all tests override via the COLLECTION_NAME header with WeaviateITCollection, but it's inconsistent with the documented v6 requirement.

Questions:

  • The <classifier>all</classifier> on io.weaviate:client6 produces a shaded/uber JAR. Could this cause classpath conflicts with other Camel components if any transitive dependencies (e.g., gRPC, Netty, protobuf) overlap? The comment explains it's required for gRPC's ServiceLoader, which is a valid reason, but worth verifying.

Positive highlights:

  • Excellent upgrade guide with the response type change table
  • Clean code improvements: extracted resolveCollectionName(), toPrimitiveFloatArray(), proper double-checked locking with volatile, client lifecycle with closeClient flag
  • Proper deprecation handling for proxy fields
  • Bug fix: replaced incorrect QdrantAction.CREATE_COLLECTION with WeaviateVectorDbAction.CREATE_COLLECTION in langchain4j embeddings IT
  • Test infra properly extended for gRPC port

This review does not replace specialized AI review tools (CodeRabbit, Sourcery) or static analysis (SonarCloud).

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Jiri Ondrusek


@Deprecated
@Metadata(label = "producer",
description = "Proxy port to connect to weaviate through")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor consistency suggestion: The scheme field is initialized with private String scheme = "http" (matching its @UriParam(defaultValue = "http")), but grpcPort only declares the default in the annotation without a field initializer. This means getGrpcPort() returns null instead of 50051 until createClient() applies the fallback. Consider initializing the field:

Suggested change
description = "Proxy port to connect to weaviate through")
private Integer grpcPort = 50051;

<dependency>
<groupId>io.weaviate</groupId>
<artifactId>client</artifactId>
<artifactId>client6</artifactId>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: The all classifier produces a shaded/uber JAR that bundles gRPC, Netty, protobuf, etc. In a large framework like Camel where many components share these transitive dependencies, is there a risk of classpath conflicts? The comment explains why it's needed (gRPC ServiceLoader), but it would be good to confirm no version collisions occur with other components.

@orpiske orpiske left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: CAMEL-23482 — Upgrade Weaviate client from v5 to v6

This is a well-executed major dependency upgrade from io.weaviate:client 5.x to io.weaviate:client6 6.2.1. The scope is appropriate, the upgrade guide is thorough, and the test coverage is complete.

Positive Observations

  • Thorough upgrade guide — Documents every breaking change with a clear migration table.
  • Proper deprecation pattern — Proxy options are correctly @Deprecated rather than removed.
  • Sound concurrency — DCL in getClient() correctly uses volatile + ReentrantLock. The closeClient flag properly distinguishes autowired clients from internally-created ones.
  • Good DRY improvementresolveCollectionName() replaces 6 copies of the same header-or-fallback pattern.
  • Incidental bug fixLangChain4jEmbeddingsComponentWeaviateTargetIT was using QdrantAction.CREATE_COLLECTION instead of WeaviateVectorDbAction.CREATE_COLLECTION.
  • classifier=all documented — Comment explains why the uber-jar classifier is needed.
  • Test-infra extended cleanly — gRPC port added across all infra service implementations.

Minor Note

The test URI path in WeaviateContainerIT is still "weaviate:test-collection" (lowercase). Since the header always overrides the collection name with "WeaviateITCollection" (PascalCase), this works. But it's inconsistent with the upgrade guide's note that v6 requires PascalCase collection names.

Overall: solid, well-documented migration. No blocking issues found.

This review does not replace specialized AI review tools (CodeRabbit, Sourcery) or static analysis (SonarCloud).

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Otavio Rodolfo Piske


@Metadata(label = "producer",
description = "gRPC port for Weaviate server connection", defaultValue = "50051")
@UriParam(defaultValue = "50051")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The field defaults to null at the Java level but is documented as defaulting to 50051 (via @UriParam/@Metadata). The runtime fallback in createClient() handles this correctly, but initializing the field as private Integer grpcPort = 50051; would be more consistent — similar to how scheme was initialized to "http" in this same PR.

Suggested change
@UriParam(defaultValue = "50051")
private Integer grpcPort = 50051;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants