1 Reply Latest reply on Jun 13, 2019 11:32 PM by Anson Zheng

    How to trigger infinispan start in clustering environment with Spring

    Anson Zheng Newbie

      Hi Guys,

      I am using infinispan7.1 on a legacy project running on tomcat for clustering(4 nodes, A, B, C, D) cache requirement. I am using existing spring 3.2  annotation with infinispan.xml and jgroups.xml to register

      <cache:annotation-driven />

      <infinispan:embedded-cache-manager id="cacheManager" configuration="classpath:infinispan.xml"/>

      and then Using @EnableCaching at class level and @Cachable at method level.

       

      The issue is the binding port is not open till the @Cachable method is invoked on each node and consequently each node makes its own service call instead of getting from clustering cache.  How can I trigger the infinispan cache(open the binding# and discover the other node) during spring/web application loading instead of explicitly invoking the service?

       

       

      Any comment is appreciated.

        • 1. Re: How to trigger infinispan start in clustering environment with Spring
          Anson Zheng Newbie

          Very weird, it is working change without any change(At least I did not find any change).

          The difference(The second line) from the log is very obviously, for example, I made a direct call to Node A and then Node B,

           

          Yesterday's Node B log:

          INFO  o.i.r.t.jgroups.JGroupsTransport.start - ISPN000078: Starting JGroups channel ISPN

          INFO  o.i.r.t.jgroups.JGroupsTransport.viewAccepted - ISPN000094:Received new cluster view for channel ISPN: [B-56020|0] (1) [B-56020]

          ....Some log for the same service call with the same key value but get different value(Not from Cache node A)

          INFO  o.i.r.t.jgroups.JGroupsTransport.viewAccepted - ISPN000093: Received new, MERGED cluster view for channel ISPN: MergeView::[B-43665|1] (2) [B-43665, A-21243], 2 subgroups: [B-43665|0] (1) [B-43665], [A-21243|0] (1) [A-21243]

           

          Today's Node B log:

          INFO  o.i.r.t.jgroups.JGroupsTransport.start - ISPN000078: Starting JGroups channel ISPN

          INFO  o.i.r.t.jgroups.JGroupsTransport.viewAccepted - ISPN000094: Received new cluster view for channel ISPN: [A-31564|1] (2) [A-31564, B-41222]

           

          Today's log showed that once the cache is triggered it found Node A immediately but yesterday's showed it did not find Node A from the beginning.

           

          Was it a network issue in the last two days? Or some change that I did not notice?