[ 
https://issues.apache.org/jira/browse/CAMEL-3686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997320#comment-12997320
 ] 

Claus Ibsen commented on CAMEL-3686:
------------------------------------

This is actually more tricky as you use the cache to *share* data between 
bundles. The cache component wasn't designed for that, hence why it clear and 
stop the cache when the endpoint is being shutdown.

What we need to do is somehow keep track of how many consumers/producers is 
accessing the cache. I think that could be difficult to do. And then only stop 
the cache if the consumers/producers count is zero.

An alternative to add an option on the endpoint to indicate its a shared cache. 
Then it's only stopped when you stop the camel-cache component. The caveat is 
that if you stop both bundles, the data in the cache is kept around, until 
camel-cache is stopped.



> camel-cache in servicemix
> -------------------------
>
>                 Key: CAMEL-3686
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3686
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cache
>         Environment: camel-cache 2.4.0-fuse-01-00
>            Reporter: Justas
>
> I am using camel-cache component in serviceMix. Cache endpoint uri is 
> "cache://elements?maxElementsInMemory=2&memoryStoreEvictionPolicy=MemoryStoreEvictionPolicy.FIFO&overflowToDisk=false&eternal=false&timeToLiveSeconds=800"
>  
> I have 2 bundles (core.jar, services.jar). Inside those bundles I use 
> @EndpointInject(uri = Constants.CACHE_URI) 
> ProducerTemplate cacheTemplate; 
> cacheTemplate.requestBodyAndHeaders(...) 
> core.jar puts and reads elements from cache. 
> services.jar only reads elements from cache. 
> After deploying both bundles it works fine, but if i uninstall services.jar, 
> cache is "destroyed". core.jar (and all others) can't put objects into cache 
> anymore. 
> How could I make all bundles to "share" the same cache? 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to