1 Reply Latest reply on Feb 5, 2015 5:30 AM by rvansa

    How to change Infinispan cache settings after it is created?

    virajn

      In my application i'm using Infinispan 5.3 version and I want to change setting after cache is initialized. Default settings will be loaded from xml file and some of the settings ( ex : eviction maxEntries, lifespan, etc ) should be able to change any time of application running (This is changed by sysadmin). Is there way to changed settings of already created cache ?

       

      I tried

       

      EmbeddedCacheManager.defineConfiguration(String cacheName, Configuration configurationOverride);

       

      but this has no effect on already created cache.

        • 1. Re: How to change Infinispan cache settings after it is created?
          rvansa

          Typically, most of the configuration cannot be changed during runtime, as the Configuration object is immutable (and many components cache it). If you want to combine XML and programmatic configuration, just look into the code you use for loading XML configuration - you'll find ConfigurationBuilder, which can be modified. I won't give you concrete examples with such outdated versions.

          Some attributes can be changed by management operation (JMX), but eviction settings are not among them. If you need to change this, you need to start a new cache and move the data manually between them.