This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 68f6f3a5ad19a9beae764962c9c54ec5644c06ec Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Jan 27 15:00:11 2021 +0100 CAMEL-16078: Deprecate camel-caffeine-lrucache and remove from camel-core pom.xml as we should use the default implementation out of the box. --- components/camel-test-junit5/pom.xml | 4 ---- components/camel-test/pom.xml | 4 ---- core/camel-caffeine-lrucache/pom.xml | 2 +- .../camel/component/caffeine/lrucache/CaffeineLRUCache.java | 1 + .../component/caffeine/lrucache/CaffeineLRUCacheFactory.java | 1 + .../camel/component/caffeine/lrucache/CaffeineLRUSoftCache.java | 1 + .../camel/component/caffeine/lrucache/CaffeineLRUWeakCache.java | 1 + core/camel-core/pom.xml | 4 ---- .../java/org/apache/camel/support/DefaultLRUCacheFactory.java | 3 +-- .../modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc | 8 ++++++++ 10 files changed, 14 insertions(+), 15 deletions(-) diff --git a/components/camel-test-junit5/pom.xml b/components/camel-test-junit5/pom.xml index e723e9a..61b95c7 100644 --- a/components/camel-test-junit5/pom.xml +++ b/components/camel-test-junit5/pom.xml @@ -64,10 +64,6 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> <artifactId>camel-controlbus</artifactId> </dependency> <dependency> diff --git a/components/camel-test/pom.xml b/components/camel-test/pom.xml index e2cb625..1b384c3 100644 --- a/components/camel-test/pom.xml +++ b/components/camel-test/pom.xml @@ -59,10 +59,6 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> <artifactId>camel-controlbus</artifactId> </dependency> <dependency> diff --git a/core/camel-caffeine-lrucache/pom.xml b/core/camel-caffeine-lrucache/pom.xml index df2bab7..8e00e06 100644 --- a/core/camel-caffeine-lrucache/pom.xml +++ b/core/camel-caffeine-lrucache/pom.xml @@ -29,7 +29,7 @@ <artifactId>camel-caffeine-lrucache</artifactId> <packaging>jar</packaging> - <name>Camel :: Caffeine LRUCache</name> + <name>Camel :: Caffeine LRUCache (deprecated)</name> <description>Camel Caffeine LRUCache support</description> <properties> diff --git a/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCache.java b/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCache.java index 36f0027..7b31aed 100644 --- a/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCache.java +++ b/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCache.java @@ -51,6 +51,7 @@ import org.slf4j.LoggerFactory; * @see CaffeineLRUSoftCache * @see CaffeineLRUWeakCache */ +@Deprecated public class CaffeineLRUCache<K, V> implements LRUCache<K, V>, RemovalListener<K, V>, Serializable { private static final Logger LOG = LoggerFactory.getLogger(CaffeineLRUCache.class); diff --git a/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheFactory.java b/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheFactory.java index aa35d6a..7796e29 100644 --- a/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheFactory.java +++ b/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheFactory.java @@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory; /** * Factory to create {@link CaffeineLRUCache} instances. */ +@Deprecated @JdkService(LRUCacheFactory.FACTORY) public final class CaffeineLRUCacheFactory extends LRUCacheFactory { diff --git a/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCache.java b/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCache.java index e68af29..f1213f7 100644 --- a/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCache.java +++ b/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCache.java @@ -54,6 +54,7 @@ import org.apache.camel.util.ObjectHelper; * @see CaffeineLRUCache * @see CaffeineLRUWeakCache */ +@Deprecated public class CaffeineLRUSoftCache<K, V> extends CaffeineLRUCache<K, V> { public CaffeineLRUSoftCache(int maximumCacheSize) { diff --git a/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUWeakCache.java b/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUWeakCache.java index 594926a..755e275 100644 --- a/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUWeakCache.java +++ b/core/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUWeakCache.java @@ -54,6 +54,7 @@ import org.apache.camel.util.ObjectHelper; * @see CaffeineLRUCache * @see CaffeineLRUSoftCache */ +@Deprecated public class CaffeineLRUWeakCache<K, V> extends CaffeineLRUCache<K, V> { public CaffeineLRUWeakCache(int maximumCacheSize) { diff --git a/core/camel-core/pom.xml b/core/camel-core/pom.xml index d7972db..02aa398 100644 --- a/core/camel-core/pom.xml +++ b/core/camel-core/pom.xml @@ -54,10 +54,6 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> <artifactId>camel-cluster</artifactId> </dependency> <dependency> diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultLRUCacheFactory.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultLRUCacheFactory.java index 2b309a1..995a140 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultLRUCacheFactory.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultLRUCacheFactory.java @@ -26,8 +26,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Default {@link LRUCacheFactory} which uses a {@link LinkedHashMap}. You can use camel-caffeine-lrucache instead which - * has a better LRUCache implementation. + * Default {@link LRUCacheFactory} which uses a {@link LinkedHashMap} based implementation. */ public class DefaultLRUCacheFactory extends LRUCacheFactory { diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc index b381567..66fa0e4 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc @@ -33,6 +33,14 @@ The method `isOnlyDynamicQueryParameters` is removed from `org.apache.camel.spi. The `onCompletion` EIP has fixed it could trigger multiple completions for a given `Exchange` +=== camel-caffeine-lrucache + +This LRUCache implementation is using an algorithm where elements that are removed may not be in strict order, and therefore +not ideal for LRU caches assuming ordering. + +The need for this implementation is not needed anymore in Camel 3, as we are using a simpler default implementation internally. +This component is deprecated, and has been removed as Maven dependency in `camel-core` pom.xml file. + === camel-activemq and camel-jms The JMS and ActiveMQ component now supports optimized toD EIP pattern by using a single endpoint/producer for dynamic destination names.