You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2016/08/10 08:04:20 UTC

[jira] [Resolved] (CAMEL-10230) Items in the cache expires even though eternal is set to true.

     [ https://issues.apache.org/jira/browse/CAMEL-10230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-10230.
---------------------------------
    Resolution: Not A Problem

> Items in the cache expires even though eternal is set to true.
> --------------------------------------------------------------
>
>                 Key: CAMEL-10230
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10230
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cache
>    Affects Versions: 2.16.2
>         Environment: Camel 2.16.2 - ServiceMix 7.0.0.M2
>            Reporter: Sebastián Laborde
>              Labels: camel-cache
>
> Items in the cache expires even though eternal is set to true. When a new element is added to the cache, its properties are set to its default values.
> Only seems to work as expected if I put the cache properties into the route itself everytime I add a new item into the cache (see below, bolded text). 
> CacheRouteBuilder:
> package uy.com.antel.pi.osgi.cache;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.component.cache.CacheConstants;
> public class CacheRouteBuilder extends RouteBuilder {
> 	private CacheAggregationStrategy CAS = new CacheAggregationStrategy();
> 	
> 	@Override
> 	public void configure() throws Exception {
> 		// TODO Auto-generated method stub
> 		
> 		// Set up Cache
> 		from("cache://MyApplicationCache?eternal=true&diskPersistent=true")
> 			.to("mock:endpoint");
> 		
> 		// CXFRS Entry Point
> 		from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
> 			.log("GET Request Received...")
> 			.choice()
> 				.when(header("operationName").isEqualTo("addEntry"))
> 					.log("In add entry choice")
> 					.log("${headers}")
> 					.to("bean:restImplBean?method=addEntry")
> 					.to("cache://MyApplicationCache*?eternal=true&diskPersistent=true*")
> 					.to("bean:restImplBean?method=addedEntry")
> 				.when(header("operationName").isEqualTo("getEntry"))
> 					.log("In get entry choice")
> 					.to("bean:restImplBean?method=getEntry")
> 					.to("cache://MyApplicationCache")
> 					.log("${headers}")
> 					.choice()
> 						.when(header(CacheConstants.CACHE_ELEMENT_WAS_FOUND).isNull())
> 				        .to("bean:restImplBean?method=notFound")
> 				        .otherwise()
> 				        .to("bean:restImplBean?method=gotEntry")
> 				    .end()
> 			.end();
> 		
> 		}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)