Hi

Yeah that sounds like a bug, you are welcome to log a JIRA ticket and
provide a fix as github PR
http://camel.apache.org/contributing

On Thu, Nov 23, 2017 at 12:51 PM, Krzysztof Hołdanowicz
<[email protected]> wrote:
> Hi all,
>
> 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);
> }
> ...
>
> }
>
> Regards
> Kris
>
> --
>
> Pozdrawiam
>
> Krzysztof Hołdanowicz



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to