camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastián Laborde (JIRA) <j...@apache.org>
Subject [jira] [Updated] (CAMEL-10230) Items in the cache expires even though eternal is set to true.
Date Tue, 09 Aug 2016 18:57:20 GMT

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

Sebastián Laborde updated CAMEL-10230:
--------------------------------------
    External issue URL: http://stackoverflow.com/questions/37488705/apache-camel-cache-configuration-is-not-working
                Labels: camel-cache  (was: )

> 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)

Mime
View raw message