2 Replies Latest reply on Dec 12, 2013 9:36 AM by rstrazza

    Infinispan 6 used of wildcards on named cache

    rstrazza

      My current cache (Coherence) uses wildcards to define maps, say map="my-cache-*" where any application could put/get data using something like "my-cache-test1" or "my-cache-test2" without the need to configure the actual map name across the cluster. I'm probably overlooking the documentation and can't find something similar, being my first impression that Infinispan namedCache doesn't support it ?

       

      Thanks!

        • 1. Re: Infinispan 6 used of wildcards on named cache
          nadirx

          No, but you can use cache configuration inheritance. Suppose you have "my-cache" defined in your CacheManager (either declaratively or programmatically), you can do as follows:

           

          ConfigurationBuilder b = new ConfigurationBuilder().read(cm.getCacheConfiguration("my-cache"));

          cm.defineConfiguration("my-cache-test1", b.build());

          Cache cache = cm.getCache("my-cache-test1");

           

          There is a defineConfiguration(name, template, overrides) which could work but unfortunately it doesn't accept a null override. I think this is something that we should do.

           

          Tristan

          1 of 1 people found this helpful
          • 2. Re: Infinispan 6 used of wildcards on named cache
            rstrazza

            Thanks for your reply Tristan and I totally agree, this feature is commonly used and is very convenient in cases like mine where we use Spring Cache.