Skip to content

CAMEL-24623: camel-infinispan - report a QUERY that has no query builder (backport to camel-4.22.x) - #26116

Open
oscerd wants to merge 1 commit into
apache:camel-4.22.xfrom
oscerd:backport/CAMEL-24623-camel-4.22.x
Open

CAMEL-24623: camel-infinispan - report a QUERY that has no query builder (backport to camel-4.22.x)#26116
oscerd wants to merge 1 commit into
apache:camel-4.22.xfrom
oscerd:backport/CAMEL-24623-camel-4.22.x

Conversation

@oscerd

@oscerd oscerd commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Backport of #26111 (CAMEL-24623) to camel-4.22.x. Clean cherry-pick, no conflicts.

Both producers ran the QUERY operation through an if (query != null) with no else branch, so a route
with neither the queryBuilder option nor the CamelInfinispanQueryBuilder header got its own message back
with no result, no exception and no log line — indistinguishable from a query that matched nothing.

The pass-through is deliberately kept: producerQueryOperationWithoutQueryBuilder has asserted it since
the operation was contributed in CAMEL-9624 (2016). Only the silence goes away — both producers now log a
WARN naming the cache, the option and the header, and the builder is resolved before the cache is looked up
so a misconfigured remote route no longer pays a Hot Rod round trip to do nothing. The embedded producer
carried the same defect and is fixed the same way.

Safe for a patch release: log-only, no behaviour change, no metadata or catalog change.

Merge after #26111.

Verification

mvn clean install -DskipITs on components/camel-infinispan is green on this branch — 89 embedded tests
and the remote module's unit tests, including the 4 new ones in InfinispanRemoteProducerQueryTest.

The full reactor was not run here: the host was under memory pressure and killed it twice. It would add
nothing for this change — the module build regenerates nothing (git status shows only the five
cherry-picked files), no annotation or metadata is touched, and the only module outside the infinispan
family that depends on camel-infinispan is camel-langchain4j-embeddings, as a test dependency with no
reference to the classes changed here.


Claude Code on behalf of oscerd

🤖 Generated with Claude Code

Both producers ran the QUERY operation through an "if (query != null)" with no
else branch, and buildQuery returns null when neither the queryBuilder option
nor the CamelInfinispanQueryBuilder header is set. A misconfigured route got its
own message back with no result, no exception and no log line, which is
indistinguishable from a query that matched nothing.

The pass-through is kept - it has been asserted by
producerQueryOperationWithoutQueryBuilder since the operation was contributed in
CAMEL-9624 - but it is now logged at WARN, naming the cache, the queryBuilder
option and the header. The builder is also resolved before the cache is looked
up, so a misconfigured remote route no longer pays a Hot Rod round trip to do
nothing.

The embedded producer carried the same defect and is fixed the same way.

Backport of fe55a9a (apache#26111).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JpshGTyfSmdq7hC8tuEwrZ
@oscerd oscerd added the bug Something isn't working label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 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 Sep 4, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-infinispan/camel-infinispan-embedded
  • components/camel-infinispan/camel-infinispan

🔬 Scalpel shadow comparison — Scalpel: 12 tested, 29 compile-only — current: 12 all tested

Maveniverse Scalpel detected 41 affected modules (current approach: 12).

⚠️ 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

Skip-tests mode would test 12 modules (2 direct + 10 downstream), skip tests for 29 (generated code, meta-modules)

Modules Scalpel would test (12)
  • camel-infinispan
  • camel-infinispan-embedded
  • 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-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (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

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

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • components/camel-infinispan/camel-infinispan: 2 test(s) disabled on GitHub Actions
All tested modules (41 modules)
  • Camel :: AI :: LangChain4j :: Embedding
  • Camel :: AI :: LangChain4j :: EmbeddingStore
  • 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 :: Infinispan :: Embedded
  • Camel :: Infinispan :: Remote
  • 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 :: 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.

Clean cherry-pick of #26111 to camel-4.22.x. Reviewed the full diff:

  • The resolveQueryBuilder extraction is correct — same resolution logic (header > config), InfinispanVectorQueryBuilder handling preserved in the remote variant.
  • Behavioral change is strictly additive: the QUERY pass-through when no builder is set is kept (CAMEL-9624 compatibility), but now warns at WARN level and avoids the unnecessary cache/Hot Rod round-trip.
  • The second null check (if (query == null)) after buildQuery(builder, cache) is defensive for a builder whose build() returns null — acceptable.
  • Tests are well-designed: exercising onQuery directly with an unstarted manager proves the "no cache access" property by construction.
  • Missing embedded producer tests, but the embedded path is simpler (no VectorQueryBuilder) and the Util method is tested transitively through the remote tests.

Note: Parent PR #26111 is still open — merge this after it lands, as stated in the description.

Suggestion: Consider setting milestone to 4.22.1.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

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

Labels

bug Something isn't working components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants