【问题标题】:EHCACHE in memeory Cache hit count is showing twice for every hit in camel Fuse内存中的 EHCACHE 缓存命中计数在骆驼保险丝中的每次命中显示两次
【发布时间】:2015-12-08 01:31:35
【问题描述】:

内存命中数显示为 EHCACHE 中预期值的两倍。这是预期的行为吗?当我第一次点击它时,它正确地显示 cacheMiss 计数为 1,但它从缓存中读取的后续命中,对于缓存中的每个命中,命中计数始终为 2。

我首先尝试从缓存中获取数据,如果找不到,则将其添加到缓存中。在这个过程中,命中是未命中的两倍。

<route handleFault="true" streamCache="true" id="MainRoute">
    <from uri="direct:start"/>
     <setHeader headerName="CamelCacheOperation">
      <constant>CamelCacheGet</constant>
    </setHeader>
    <setHeader headerName="CamelCacheKey">
      <simple>${property.employeeId}</simple>
    </setHeader>
    <to uri="cache://EmployeeCache"/>
    <choice>
      <when>
        <simple>${header.CamelCacheElementWasFound} == null</simple>
        <to uri="direct:AddDataRoute"/>
        <setHeader headerName="CamelCacheOperation">
          <constant>CamelCacheAdd</constant>
        </setHeader>
        <setHeader headerName="CamelCacheKey">
          <simple>${property.employeeId}</simple>
        </setHeader>
        <to uri="cache://EmployeeCache"/>
      </when>
    </choice>
  </route>

===== Fuse Ehcache Statistics for the above senario

【问题讨论】:

    标签: ehcache jbossfuse


    【解决方案1】:

    我建议查看访问缓存的代码。最新版本中不存在每次缓存命中被计算两次的已知错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-02
      • 2017-08-29
      • 2016-09-15
      • 1970-01-01
      相关资源
      最近更新 更多