This is an automated email from the ASF dual-hosted git repository.
pcongiusti 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 f04e9c4d9f21 chore(components): add a note to clarify cache closure
design
f04e9c4d9f21 is described below
commit f04e9c4d9f21a1231fdd699e8f738f9ea8e3b4fe
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Thu Nov 27 11:51:24 2025 +0100
chore(components): add a note to clarify cache closure design
---
.../java/org/apache/camel/component/jcache/policy/JCachePolicy.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/policy/JCachePolicy.java
b/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/policy/JCachePolicy.java
index e764e13862ea..bee777b5a173 100644
---
a/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/policy/JCachePolicy.java
+++
b/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/policy/JCachePolicy.java
@@ -100,8 +100,10 @@ public class JCachePolicy implements Policy {
cache = cacheManager.getCache(cacheName);
if (cache == null) {
LOG.debug("Create cache:{}", cacheName);
+ // NOTE: the cache must not be closed. The closure is managed
by the client
+ // (the component in this case) which will close it according
to Camel lifecycle.
cache = cacheManager.createCache(cacheName,
- cacheConfiguration != null ? this.cacheConfiguration :
(Configuration) new MutableConfiguration());
+ cacheConfiguration != null ? this.cacheConfiguration :
(Configuration) new MutableConfiguration()); // NOSONAR
}
}