springboot3 integrates ehcache3

In the springboot3.x version, the tags related to cache management have been changed. Some examples of supported cache providers in the official documents are as follows. There is no longer an ehcache tag to specify ehcache, but it is unified as jcache (Java cache universal standard), that is Recognizable.

# Only necessary if more than one provider is present
spring:
  cache:
    jcache:
      provider: "com.example.MyCachingProvider"
      config: "classpath:example.xml"

The official description of spring is as follows

JCache is bootstrapped through the presence of a javax.cache.spi.CachingProvider on the classpath (that is, a JSR-107 compliant caching library exists on the classpath), and the JCacheCacheManager is provided by the spring-boot-starter-cache “Starter”. Various compliant libraries are available, and Spring Boot provides dependency management for Ehcache 3, Hazelcast, and Infinispan. Any other compliant library can be added as well.

It might happen that more than one provider is present, in which case the provider must be explicitly specified. Even if the JSR-107 standard does not enforce a standardized way to define the location of the configuration file, Spring Boot does its best to accommodate setting a cache with implementation details, as shown in the following example:

translate

JCache is booted by the existence of javax.cache.spi.CachingProvider on the classpath (that is, there is a cache library that conforms to the JSR-107 standard on the classpath), and the JCacheCacheManager is provided by the spring-boot-starter-cache "starter". There are various compatible libraries, and Spring Boot provides dependency management for Ehcache 3, Hazelcast, and Infinispan. Any other compatible libraries can also be added.

There may be situations where there is more than one provider, in which case the provider must be specified explicitly. Even though the JSR-107 standard does not mandate defining the location of configuration files in a standardized way, Spring Boot does its best to accommodate the implementation details of setting up the cache, as shown in the following example:

 

 

Guess you like

Origin blog.csdn.net/m0_54250110/article/details/130144884