camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-12037) File idempotent repository is always initialized with default 1000 cache size
Date Sat, 25 Nov 2017 17:06:00 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-12037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16265768#comment-16265768
] 

ASF GitHub Bot commented on CAMEL-12037:
----------------------------------------

davsclaus closed pull request #2118: CAMEL-12037 Idempotent repository cache initialization
fix.
URL: https://github.com/apache/camel/pull/2118
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
b/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
index f452346dc80..01796f2ba35 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
@@ -334,8 +334,11 @@ protected void loadStore() throws IOException {
     protected void doStart() throws Exception {
         ObjectHelper.notNull(fileStore, "fileStore", this);
 
-        // default use a 1st level cache
-        this.cache = LRUCacheFactory.newLRUCache(1000);
+        //CAMEL-12037
+        if (this.cache == null) {
+        	// default use a 1st level cache
+        	this.cache = LRUCacheFactory.newLRUCache(1000);
+        }
 
         // init store if not loaded before
         if (init.compareAndSet(false, true)) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> File idempotent repository is always initialized with default 1000 cache size
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-12037
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12037
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.20.0
>            Reporter: Krzysztof Hołdanowicz
>             Fix For: 2.20.2, 2.21.0
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> http://camel.465427.n5.nabble.com/File-idempotent-repository-problem-since-2-20-td5815760.html
> So far we've been using file idempotent repository which was defined like 
> this: 
> <bean id="download repository" 
> class="of.apache.camel.processor.idempotent.FileIdempotentRepository"> 
>   <property name="fileStore" value="work/.downloadStore.dat" /> 
>   <property name="cacheSize" value="5000" /> 
> </bean> 
> However since Camel version 2.20 I can see that in 
> FileIdempotentRepository.java there is a cache initialization in method 
> doStart(): 
> protected void doStart() throws Exception { 
>  ... 
>  this.cache = LRUCacheFactory.newLRUCache(1000); 
>  ... 
> } 
> which always overrides our cacheSize definition with default value, because 
> doStart method is always invoked just after bean initialization (if the 
> init-method="start" was specified in bean definition) or during camel 
> context initialization. 
> As a consequence our idempotent stores always have a default 1000 cache 
> size limit. 
> Shuldn't the doStart method check the cache instance first before 
> initializing it with default cache size e.g. 
> protected void doStart() throws Exception { 
> ... 
> if (this.cache == null) { 
>   this.cache = LRUCacheFactory.newLRUCache(1000); 
> } 
> ... 
> } 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message