ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suhuadong <suhuadong...@163.com>
Subject How to continuously subscribe for event?
Date Mon, 24 Oct 2016 13:19:55 GMT
hi,team

My cache subscribe the EVT_CACHE_OBJECT_EXPIRED,I want the event trigger
every a minute.
But,I find that the event only trigger once.

My code:

   IgnitePredicate<CacheEvent> rmtLsnr = new Task();
       
Ignition.ignite().events(Ignition.ignite().cluster().forCacheNodes("myCache")).remoteListen(null,rmtLsnr,
EventType.EVT_CACHE_OBJECT_EXPIRED);



static class Task implements  IgnitePredicate<CacheEvent>,Serializable {
        private static final long serialVersionUID = 6529685098267757690L;
        
        @Override
        public boolean apply(CacheEvent evt) {
            System.out.println(oldVal.getClass());
            Ignition.ignite().cache("myCache").put(dvId,oldVal);
      }





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-continuously-subscribe-for-event-tp8438.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message