[
https://issues.apache.org/jira/browse/CAMEL-6698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14287433#comment-14287433
]
ASF GitHub Bot commented on CAMEL-6698:
---------------------------------------
GitHub user arturchyzy opened a pull request:
https://github.com/apache/camel/pull/375
CAMEL-6698: Component camel-cache to support non-serializable objects
Ability to store non-serialiable objects into ehcache cache - i called it
objectCache. What i modified:
- new configuration param to turn on non-serializable cache - objectCache
- validation to not allow to create object cache which will use object
serialization (overflowToDisk and diskPersistence) - overflowToDisk is default
- storing object into cache without using type converters
Things to consider:
```java
else if (body instanceof Serializable) {
element = new Element(key, body);
} else if (config.isObjectCache()) {
element = new Element(key, body);
}
```
can be optimized to
```java
else if (body instanceof Serializable || config.isObjectCache()) {
element = new Element(key, body);
}
```
as the same contructor using java.lang.Object will be taken as body is of
java.lang.Object
Usage
To use object cache you have to set objectCache param and disable disk cach
i.e.
```
cache://TestCache1?objectCache=true&overflowToDisk=false&diskPersistent=false
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/arturchyzy/camel CAMEL-6698
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/375.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #375
----
commit 4d6c7d52b79b44198ba16f5e90cf849db81789c0
Author: Artur Chyży <[email protected]>
Date: 2015-01-22T13:43:49Z
CAMEL-6698: Component camel-cache to support non-serializable objects
----
> Component camel-cache to support non-serializable objects
> ---------------------------------------------------------
>
> Key: CAMEL-6698
> URL: https://issues.apache.org/jira/browse/CAMEL-6698
> Project: Camel
> Issue Type: Improvement
> Components: camel-cache
> Affects Versions: 2.10.4
> Environment: All
> Reporter: Lalit Manchanda
> Priority: Minor
> Fix For: Future
>
>
> EhCache supports non-serializable objects for local heap storage, though the
> camel-cache does not allow such objects to be put to cache.Should have
> mechanism/flow to handle such objects
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)