跳至主要内容

博文

目前显示的是标签为“Infinispan”的博文

Caching with Infinispan(Remote standalone server)

Spring Caching with Infinispan(Remote standalone server) Infinispan Spring Integration provides   SpringRemoteCacheManager   to connect remote infinispan server. Get JBoss Infinispan Download a copy of   JBoss Infinispan . Install it into your local system, and make sure it is running. Enable Caching Add   @EnableCaching(mode=AdviceMode.ASPECTJ)   annotation on the configuration class if you are using Java based configuration. @Configuration ... @EnableCaching(mode=AdviceMode.ASPECTJ) public class JpaConfig {...} Then, specify a   CacheManager   provider in your configuration. There is a   SpringRemoteCacheManager   provided by Infinispan Spring integration. @Override @Bean public CacheManager cacheManager() { return new SpringRemoteCacheManager( new RemoteCacheManager( new ConfigurationBuilder() .addServer() .host("localhost") .build() ) ); } @Override @Bean public KeyGenerator keyGenerat...

Caching with Infinispan

Spring Caching with Infinispan JBoss Infinispan is popular distributed caching solution, it is the base of RedHad Data Grid product. In the real world projects, Infinispan can work in several ways. Run as a standalone server. Run as JBoss service. Embedded. Infinispan also provides Spring integration, and provides two different   CacheManager   implementations for embedded way and standalone servers. This post focus on the embedded way, the next post will contain the standalone environment configuration. Enable Caching Add   @EnableCaching(mode=AdviceMode.ASPECTJ)   annotation on the configuration class if you are using Java based configuration. @Configuration ... @EnableCaching(mode=AdviceMode.ASPECTJ) public class JpaConfig {...} Then, specify a   CacheManager   provider in your configuration. There is a   SpringEmbeddedCacheManager   provided by Infinispan Spring integration. @Override @Bean public CacheManager cacheMana...