Dear all,

I tried to play around with the setPageSize and setTimeInterval on
Continuous Query, but it doesn't seem to have any effect. My code is like:

  private void configOrderListener(Ignite ignite) {
    IgniteCache<OrderPK, Order> cache =
ignite.cache(StoreHelper.getCacheName(OrderStore.class));

    ContinuousQuery<OrderPK, Order> qry = new ContinuousQuery<>();

//    qry.setPageSize(20);
    qry.setLocal(true);
    qry.setTimeInterval(2000L);
    qry.setLocalListener(createOrderHandler());

    cache.query(qry);
  }

  private CacheEntryUpdatedListener<OrderPK, Order> createOrderHandler() {
    return (evts) -> {
      log.info("batch size: {}", Iterables.size(evts));

      evts.forEach(
              e -> {
                if (e.getEventType().equals(EventType.CREATED) ||
e.getEventType().equals(EventType.UPDATED)) {
                  log.info("{}", e);
                  redisService.publish("user.order." +
e.getValue().getSymbol() + "." + e.getValue().getKey().getAccountUuid(),
e.getValue()).block();
                }
              });
    };
  }


What I expect is I will be receiving event every 2000ms, but the result was
I received each event immediately without any batching. I've tried to set
the page size, but no effect as well. Am I doing sth wrong? Please kindly
advise. 

Thanks,
Rick



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

Reply via email to