You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2026/09/04 07:11:20 UTC

[PR] Fix infinispan example: create the missing default cache on startup [camel-spring-boot-examples]

Croway opened a new pull request, #201:
URL: https://github.com/apache/camel-spring-boot-examples/pull/201

   ## Summary
   
   `camel infra run infinispan` only provisions the `default` cache-container on the Infinispan server, it does not create a cache inside it (confirmed unchanged since at least the `camel-4.22.0` tag in apache/camel — not a recent regression). The example's route uses `to("infinispan://default")`, which assumes the cache already exists, so following the documented README workflow (`camel infra run infinispan` + `mvn spring-boot:run`) throws `CacheNotFoundException` / `NullPointerException`. The test suite masked this by spinning up its own container with a hand-written, outdated `infinispan.xml` (schema 13.0) that predeclared the cache — so it never exercised the documented workflow and the regression went unnoticed.
   
   Separately, the plaintext `admin`/`password` credentials in `application.properties` now trigger `CamelSecurityPolicyAutoConfiguration` "SECURITY WARNING: plain-text secret" warnings introduced in Camel 4.23.
   
   ## Changes
   
   - Add `InfinispanConfiguration`: a `RemoteCacheManager` `@Bean` that calls `administration().getOrCreateCache("default", ...)` on startup and is autowired into the `infinispan` component by type — the same pattern camel-infinispan's own IT tests use (`InfinispanRemoteTestSupport#getOrCreateCache`). No manual REST step required; the example runs OOTB again.
   - Move connection settings out of `camel.component.infinispan.*` (now unused/redundant, since the component uses the bean directly) into plain `infinispan.*` properties backed by `${ENV_VAR:default}` placeholders. This also resolves the plaintext-secret warnings, since `CamelSecurityPolicyAutoConfiguration` only scans `camel.*`-prefixed keys.
   - Rewrite `ApplicationTest` to use `camel-test-infra-infinispan`'s `InfinispanServiceFactory` + `@DynamicPropertySource` instead of a hand-rolled Testcontainers setup, so the test now exercises the exact same server config as `camel infra run infinispan` and would catch this kind of regression.
   - Update the README to explain the cache-creation behavior and the env vars for pointing at a different server, and drop the now-inaccurate "runs OOTB" implication.
   
   ## Test plan
   
   - [x] `mvn test` passes (spins up Infinispan via `camel-test-infra-infinispan`, verifies the route puts/gets a key through the auto-created cache)
   - [x] Verified live: `camel infra run infinispan` + `mvn spring-boot:run` — reproduced the original `CacheNotFoundException`/NPE before the fix, confirmed clean startup and `Received body: test` with no exceptions and no security warnings after the fix
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01Wgr7MBBqUbNGG6xrH6ybWq


-- 
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] Fix infinispan example: create the missing default cache on startup [camel-spring-boot-examples]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway merged PR #201:
URL: https://github.com/apache/camel-spring-boot-examples/pull/201


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