Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-14487

Embedded spring boot starter configuration issue in spring boot 3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 14.0.6.Final
    • Spring Integration
    • None
    • Hide

      1.create a spring boot 3 project

      2.include infinispan-spring-boot-starter-embedded

      Create a configuration bean with

      @EnableCaching(proxyTargetClass = true)

      @Configuration

      public class CacheConfiguration {

      @Bean
      public InfinispanCacheConfigurer cacheConfigurer() {
      return manager -> {

      log.info("Configuring cache with expiration of {} ms", expirationInMs);
      final org.infinispan.configuration.cache.Configuration ispnConfig = new ConfigurationBuilder()
      .clustering()
      .cacheMode(CacheMode.LOCAL)
      .memory()
      .expiration().lifespan(36000>, TimeUnit.MILLISECONDS)
      .build();
      manager.createCache("mycache", ispnConfig);

      }
      }

      }

       

      In the trace log I can see the EmbeddedCacheManager being created, but if I inspect the source code, it seems soem annotations are not inlcuded in the -jakarta jar: under factories

      import org.infinispan.factories.annotations.SurvivesRestarts;
      import org.infinispan.factories.scopes.Scope;
      import org.infinispan.factories.scopes.Scopes;

      Show
      1.create a spring boot 3 project 2.include infinispan-spring-boot-starter-embedded Create a configuration bean with @EnableCaching(proxyTargetClass = true) @Configuration public class CacheConfiguration { @Bean public InfinispanCacheConfigurer cacheConfigurer() { return manager -> { log.info("Configuring cache with expiration of {} ms", expirationInMs); final org.infinispan.configuration.cache.Configuration ispnConfig = new ConfigurationBuilder() .clustering() .cacheMode(CacheMode.LOCAL) .memory() .expiration().lifespan(36000>, TimeUnit.MILLISECONDS) .build(); manager.createCache("mycache", ispnConfig); } } }   In the trace log I can see the EmbeddedCacheManager being created, but if I inspect the source code, it seems soem annotations are not inlcuded in the -jakarta jar: under factories import org.infinispan.factories.annotations.SurvivesRestarts; import org.infinispan.factories.scopes.Scope; import org.infinispan.factories.scopes.Scopes;

      When upgrading to Spring Boot 3.0.2, using

      infinispan-spring-boot-starter-embedded

      and replacing infinispan-core with infinispan-core-jakarta (14.0.6.Final)

      The cacheConfigurer never invokes the function with EmbeddedCacheManager

       

       

      The only way to configure the cache is by using infinispan.xml, but haven't found a way to add all the config. like listeners, in the xml file.

      If this is a deprecated way to configure 

              Unassigned Unassigned
              annemarteh Anne Marte Hjemås (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: