[infinispan-dev] Got a local cache despite it is configured as distributed

Pierrick HYMBERT pierrick.hymbert at gmail.com
Tue Feb 2 03:19:41 EST 2016


Hi all,

I am blocked to deploy a test app that use a distributed infinispan (8.0.1)
cache within 2 wildfly (10.0.0) domain nodes and a cache entry producer
deployed as clustered singleton service.

Your feedback/advise are really appreciated!

Cache definition:

                <cache-container name="my-cache-container">
                    <transport lock-timeout="60000"/>
                    <distributed-cache name="myAppCache" mode="SYNC">
                        <transaction mode="NONE"/>
                        <eviction strategy="NONE"/>
                    </distributed-cache>
                </cache-container>

Sample code:

  @Resource(lookup = "java:jboss/infinispan/container/my-cache-container")
  private EmbeddedCacheManager cacheContainer;

  private Cache<Long, Long> myAppCache;

  @PostConstruct
  public void startNotClustered() throws NamingException {
    this.myAppCache = this.cacheContainer.getCache("myAppCache");
    ...
  }

  ...

  @Schedule(hour = "*", minute = "*", second = "*")
  public void consume() {
    logger.info("Cache size on node {} = {}",
        System.getProperty("jboss.node.name"), myAppCache.size());
  }


Server one sample logs:
2016-01-31 14:52:03,789 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 1) Produce
new cache entry 1454241123789 on node master:server-one
2016-01-31 14:52:04,005 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 2) Cache
size on node master:server-one = 35
2016-01-31 14:52:04,796 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 3) Produce
new cache entry 1454241124796 on node master:server-one
2016-01-31 14:52:05,006 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 4) Cache
size on node master:server-one = 36
2016-01-31 14:52:05,801 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 5) Produce
new cache entry 1454241125801 on node master:server-one
2016-01-31 14:52:06,007 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 6) Cache
size on node master:server-one = 37
2016-01-31 14:52:06,807 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 7) Produce
new cache entry 1454241126807 on node master:server-one
2016-01-31 14:52:07,005 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 8) Cache
size on node master:server-one = 38
2016-01-31 14:52:07,813 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 9) Produce
new cache entry 1454241127813 on node master:server-one
2016-01-31 14:52:08,006 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 10) Cache
size on node master:server-one = 39
2016-01-31 14:52:08,817 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 1) Produce
new cache entry 1454241128817 on node master:server-one
2016-01-31 14:52:09,007 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 2) *Cache
size on node master:server-one = 40*

Server two logs:
2016-01-31 14:51:56,006 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 4) Cache
size on node master:server-two = 0
2016-01-31 14:51:57,008 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 5) Cache
size on node master:server-two = 0
2016-01-31 14:51:58,007 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 6) Cache
size on node master:server-two = 0
2016-01-31 14:51:59,007 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 7) Cache
size on node master:server-two = 0
2016-01-31 14:52:00,006 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 8) Cache
size on node master:server-two = 0
2016-01-31 14:52:01,008 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 9) Cache
size on node master:server-two = 0
2016-01-31 14:52:02,007 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 10) Cache
size on node master:server-two = 0
2016-01-31 14:52:03,006 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 1) Cache
size on node master:server-two = 0
2016-01-31 14:52:04,007 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 2) Cache
size on node master:server-two = 0
2016-01-31 14:52:05,008 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 3) Cache
size on node master:server-two = 0
2016-01-31 14:52:06,006 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 4) Cache
size on node master:server-two = 0
2016-01-31 14:52:07,006 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 5) Cache
size on node master:server-two = 0
2016-01-31 14:52:08,007 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 6) Cache
size on node master:server-two = 0
2016-01-31 14:52:09,007 INFO
 [org.hypik.test.jboss.eap7.server.TestService] (EJB default - 7) *Cache
size on node master:server-two = 0*


I have attached all necessary info to investigate, but I am not sure
attachement is allowed, so you can see source and logs here:
https://www.dropbox.com/s/l1uhmfg5tkjkikw/infinispan-issue-wildfly-10.0.0.zip?dl=0

С уважением / Cordialement / Best regards,

*Pierrick **HYMBERT*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20160202/182c803a/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: infinispan-issue-wildfly-10.0.0.zip
Type: application/zip
Size: 64502 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/infinispan-dev/attachments/20160202/182c803a/attachment-0001.zip 


More information about the infinispan-dev mailing list