Axon 2.1, Spring, JCache

Hi Allard,

Congratulations on the release of Axon 2.1. I was quite excited to find the new cluster callback for completed event listening among other great new features.

I’m having issues with the wiring of JCache for the repository beans. Do you have a Spring XML example of wiring up ehcache-jcache 1.5.0-05? I’m blocked on injecting a Classloader.

Also the documentation states that Axon 2.1 uses EhCache-JCache “1.0.5-0.5” instead of “1.5.0-0.5”.


Hi Randy,

are you using the JCacheFactoryBean? It should be easy to configure (you can only specify a name and a classloader).
But since Axon requires a cache instance, you may have to create a bean that invokes the “getCache(cacheName)” method on that CacheManager.
I believe this is the way to do it (don’t have the ability to check, right now):

I admit, there is room for API improvement here, but since the Cache API is still changing, it might all be a waste of time.



Well that was embarrassingly simple.

Thank you for your time and experience on this Allard.