2 Replies Latest reply on Aug 2, 2016 10:13 AM by David D

    Infinispan Caches programmatically created via javax.cache.CacheManager

    David D Newbie

      I'm very new to infinispan and I am having some trouble I'm hoping someone can shed some light on for me.

      Some general information:

        I'm running Wildfly 8 and Infinispan 7.2

        When I debug, I can see that all of my implementations are indeed Infinispan

        I have a service bean that does my cache management, goes and gets the caching provider and manager, finds / creates caches as needed, etc, and this appears to function properly, but through the wildfly cli or management console I can't find any management information. How should I be looking at and determining whether the caches are configured correctly, aside from debugging? After I've enabled "management" and "statistics" where do I utilize those settings? Where do I find the statistics?

       

      (1) First, a general question, what role do the "cache-containers" serve? What value is there to having multiple containers? is this primarily to define different configuration profiles?

       

      (2) My wildfly standalone-full.xml defines some cache-containers, and these are conveniently displayed with configuration information within the JBoss Management UI -> Configuration (Tab) -> Infinispan (tree node). Though when I create a cache via the javax.cache.CacheManager, I can't find my new cache anywhere in here (even though I can use it and it is working as advertised). I have set "management" and "statistics" to true during configuration setup thinking these might have something to do with it, but they still don't show up.

       

      (3) When I create a cache via javax.cache.CacheManager, is there a way for me to "put" / "associate" the new cache with one of the cache-containers that exist already? Is there value to this?

       

      Thanks in advance for your patience with my ignorance.

        • 1. Re: Infinispan Caches programmatically created via javax.cache.CacheManager
          Sebastian Łaskawiec Apprentice

          Hi David!

           

          Please have a look at a JMX console ($Infinispan_server/bin/jconsole.sh or JViasualVM tool). The statistics are exposed as MBeans.

           

          Answering your questions:

          1) Yes, there are scenarios where you can have more than 1 cache container and expose it to different clients (say one of the client connects to Cache Container 1 whereas other to Cache Container 2).

          2) Hmm that's interesting... I'm assuming you tried turning globalConfigurationBuilder.globalJmxStatistics().enable() on? If so - could you please create a JIRA for this?

          3) Assuming you're playing with DefaultCacheManager, when you invoke getCache method, the DefaultCacheManager checks if it has been already created and if not, gives you a new Cache. So it's happening exactly the way you described it.

           

          Thanks

          Sebastian

          • 2. Re: Infinispan Caches programmatically created via javax.cache.CacheManager
            David D Newbie

            Thanks a lot for taking the time to answer. I've since gotten JMX Console up and have been able to review the statistics as you suggested.

            I don't think I used the globalConfigurationBuilder to set globalJmxStatistics to enabled, maybe that's why I didn't see the caches in JBoss. I'll give this a try.

            Thanks!