Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12037

File idempotent repository is always initialized with default 1000 cache size

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.20.0
    • Fix Version/s: 2.20.2, 2.21.0
    • Component/s: camel-core
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Novice

      Description

      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); }


      ...

      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              zurkin Krzysztof Hołdanowicz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified