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

EhcacheAggregationRepository drops messages on OversizeMappingException

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Information Provided
    • 3.14.7
    • None
    • camel-ehcache
    • None
    • Unknown

    Description

      When using an EhCacheAggregationRepository with an offheap store and the aggregated exchange becomes too large, the cache entry is cleared, effectively loosing exchanges.

      Have a route that aggregates string message bodies by aggregating them by concatinating the messages.  The aggregation is completed per 100 messages or 5 minutes. The aggregationRepository has a disk backed store.

      When the aggregated exchange becomes to large, EhCache throws an 

       o.e.i.i.r.RobustResilienceStrategy - Ehcache key true recovered from
      org.ehcache.spi.resilience.StoreAccessException: The element with key 'true' is too large to be stored in this offheap store.
              at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.computeWithRetry(AbstractOffHeapStore.java:1038)        at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.put(AbstractOffHeapStore.java:250)
              at org.ehcache.impl.internal.store.tiering.TieredStore.put(TieredStore.java:108) 

      after this call the entry in the cache is removed, effectively loosing messages.

              cacheManager.createCache("cacheName", CacheConfigurationBuilder
                      .newCacheConfigurationBuilder(String.class, DefaultExchangeHolder.class,
                              ResourcePoolsBuilder.newResourcePoolsBuilder()
                                      .heap(1000, EntryUnit.ENTRIES)
                                      .disk(1, MemoryUnit.MB, true))
                      .withExpiry(ExpiryPolicyBuilder.noExpiration()));

      Attached is a project demonstrating the behaviour. As a reference there is also a variant with LevelDb which behaves as expected.

      Attachments

        1. aggregation-investigation.zip
          10 kB
          Pieter Callewaert

        Activity

          People

            Unassigned Unassigned
            callewaertp Pieter Callewaert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: