title: Apache Camel Cache Configuration Is Not Working
body: <p>I want to put non-serializable object to camel cache and get.
  In route configuration of cache I set objectCache parameter to true as seen below.  </p>
  
  <pre><code> from("cache://MyCache"
             + "?maxElementsInMemory=5" +
              "&amp;memoryStoreEvictionPolicy=" +
              "MemoryStoreEvictionPolicy.FIFO" +
              "&amp;overflowToDisk=false" +
              "&amp;timeToLiveSeconds=300" +
              "&amp;objectCache=true" +
              "&amp;diskExpiryThreadIntervalSeconds=30").to("mock:endpoint");
  </code></pre>
  
  <p>There is no problem in inserting to cache with following code.</p>
  
  <pre><code>from("direct:addToCache").process(new Processor() {
              @Override
              public void process(Exchange exchange) throws Exception {
                  MyObject ad = (MyObject) exchange.getIn().getBody();
                  String key= ad.getId();
                  WebServiceResponse value= ad.getWebServiceResponse();
                  exchange.getIn().setHeader(CacheConstants.CACHE_OPERATION, CacheConstants.CACHE_OPERATION_ADD);
                  exchange.getIn().setHeader(CacheConstants.CACHE_KEY, key);
                  exchange.getIn().setBody(value);
              }
          }).to("cache://MyCache");
  </code></pre>
  
  <p>But while getting element from cache following exception thrown.</p>
  
  <pre><code>org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: com.aaa.model.WebServiceResponse to the required type: java.io.InputStream with value com.aaa.model.WebServiceResponse@5781f3d4
   at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:185)
   at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:156)
   at org.apache.camel.component.cache.CacheProducer.createElementFromBody(CacheProducer.java:132)
   at org.apache.camel.component.cache.CacheProducer.performCacheOperation(CacheProducer.java:82)
   at org.apache.camel.component.cache.CacheProducer.process(CacheProducer.java:71)
   at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
   at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:141)
   at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
   at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:460)
   at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
   at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)
   at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
   at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
   at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
   at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
   at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
   at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
   at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:412)
   at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:380)
   at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:270)
   at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:380)
  </code></pre>
  
  <p>While debugging CacheProducerClass.createElementFromBody method,I notice that objectCache parameter is set as false. All the other parameters are set as the defult values.(maxElementsInMemory=1000 and memoryStoreEvictionPolicy = MemoryStoreEvictionPolicy.LFU)</p>
  
  <p>com.aaa.model.WebServiceResponse class is not Serializable.</p>
  
  <p>Do you have any idea about this problem?
  Why cache parameters are not overridden with the values in cache definition?</p>