Cache Component configuration requires MemoryStoreEvictionPolicy instance, will 
not accept parameter as part of URI
-------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-3078
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3078
             Project: Apache Camel
          Issue Type: Bug
    Affects Versions: 2.4.0
         Environment: Camel core and cache component retrieved from Maven repo
            Reporter: John Ellis


In Spring, if one attempts to specify a cache endpoint as:
<endpoint id="myCache" 
uri="cache://MyCache?memoryStoreEvictionPolicy=MemoryStoreEvictionPolicy.FIFO"/>
an exception will be thrown that the String "MemoryStoreEvictionPolicy.FIFO" 
was not a proper Java Object and no TypeConverter is available. This can be 
worked-around by manually creating a type converter that performs:
    String policyName = evictionPolicy.replace("MemoryStoreEvictionPolicy.", 
"");
    return MemoryStoreEvictionPolicy.fromString(policyName);

Or one could just try to create a new instance from reflection. Above way is a 
bit more manageable however, since EhCache is taking care of the conversion for 
you.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to