You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ncasaux <ni...@soprasteria.com> on 2015/12/30 09:28:43 UTC
Re: camel cache configurationFile
For the future, here what has been done to solve my issue:
<blueprint>
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
<ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"
/>
<bean id="cache" class="org.apache.camel.component.cache.CacheComponent">
<property name="configurationFile"
value="file:$[karaf.base]/etc/ehcache.xml" />
</bean>
</blueprint>
For monitoring the cache, I set the attribute monitoring="on" in the
ehcache.xml.
--
View this message in context: http://camel.465427.n5.nabble.com/camel-cache-configurationFile-tp5774492p5775600.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel cache configurationFile
Posted by vassilis <2b...@gmail.com>.
Hi,
Just solved the same issue without having a dependency on the Karaf
installation path:
You have to include the ehcache.xml file in your bundle jar file. E.g. you
may have it as
<http://camel.465427.n5.nabble.com/file/n5791855/ehcache.png>
and point to it:
<bean id="cache" class="org.apache.camel.component.cache.CacheComponent">
* <property name="configurationFile"
value="classpath:com/edmi/certificates/management/meters/routes/ehcache.xml"
/>*
</bean>
In any case to include it in a different way you can configure your maven
bundle plugin to do so.
------------Details---------------
blueprint.xml:
<bean id="ehCacheManagementService"
class="net.sf.ehcache.management.ManagementService"
init-method="init" activation="eager">
<argument>
<bean class="net.sf.ehcache.CacheManager" factory-method="getInstance" />
</argument>
<argument>
<bean class="org.springframework.jmx.support.JmxUtils"
factory-method="locateMBeanServer" />
</argument>
<argument value="true" />
<argument value="true" />
<argument value="true" />
<argument value="true" />
</bean>
<bean id="cache" class="org.apache.camel.component.cache.CacheComponent">
<property name="configurationFile"
value="classpath:com/edmi/certificates/management/meters/routes/ehcache.xml"
/>
</bean>
ehcache.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache>
<defaultCache maxElementsInMemory="1000" eternal="false"
timeToIdleSeconds="120" timeToLiveSeconds="200" />
<cache
name="initAndGetLineCounterForKey"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false"
diskPersistent="false"
memoryStoreEvictionPolicy="LFU"
transactionalMode="off"
maxElementsInMemory="10000"
/>
</ehcache>
--
View this message in context: http://camel.465427.n5.nabble.com/camel-cache-configurationFile-tp5774492p5791855.html
Sent from the Camel - Users mailing list archive at Nabble.com.