Hi,
   handleEntry() performs internal housekeeping chores.
  
   You are correct a notification is sent to localListeners whether an entry
was filtered or not.
   your actual local listener will be called only if the entry has passed
your filter criteria.

  If you place a breakpoint inside
CacheContinuousQueryHandler#notifyLocalListener you will see that 
  this message gets rejected by the caller.
  here:    if (F.isEmpty(evts))     return;



   In general you shouldn't need to go so far deeply into the internals:

Try the following:

server:
        IgniteCache<Integer, String> cache =
ignite.getOrCreateCache(CACHE_NAME);


        int i = 0;
        while (true) {
            cache.put(i++, Integer.toString(i));
            System.out.println("added entry: " + i);
           Thread.sleep(100);
        }


client:
        IgniteCache<Integer, String> cache =
ignite.getOrCreateCache(CACHE_NAME);

                    ContinuousQuery < Integer, String > qry = new
ContinuousQuery<>();
                    qry.setLocalListener((evts) -> evts.forEach(e ->
System.out.println("key=" + e.getKey() + ", val=" + e.getValue())));
                   
qry.setRemoteFilterFactory((Factory<CacheEntryEventFilter&lt;Integer,
String>>) () -> (CacheEntryEventFilter<Integer, String>) e -> e.getKey() % 2
== 0);
                    cache.query(qry);


  Only the filtered events should arrive.

Thanks, Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to