apache ignite java 瘦客户端过期条目侦听器
apache ignite java thin client expired entry listener
Apache Ignite 支持 ContinuousQuery 和本地侦听器,用于输入事件,如 create、put、delete.但是当我尝试监听过期的条目事件时,它不起作用。
有重现 java thin client example.
的代码示例
如果将事件类型更改为 CREATED,它会按预期工作:
query.setRemoteFilterFactory((Factory<CacheEntryEventFilter<Integer, String>>) () -> e -> e.getEventType().equals(EventType.CREATED));
ignite java 瘦客户端是否支持 Expired 条目事件类型的本地侦听器?
您需要使用
显式配置侦听 EXPIRED
事件
query.setIncludeExpired(true)
根据JavaDoc:
Sets the flag value defining whether to notify about EventType.EXPIRED
events. If true, then the remote listener will get notifications about
entries expired in cache. Otherwise, only EventType.CREATED,
EventType.UPDATED and EventType.REMOVED events will be fired in the
remote listener. This flag is false by default, so EventType.EXPIRED
events are disabled.
Apache Ignite 支持 ContinuousQuery 和本地侦听器,用于输入事件,如 create、put、delete.但是当我尝试监听过期的条目事件时,它不起作用。 有重现 java thin client example.
的代码示例如果将事件类型更改为 CREATED,它会按预期工作:
query.setRemoteFilterFactory((Factory<CacheEntryEventFilter<Integer, String>>) () -> e -> e.getEventType().equals(EventType.CREATED));
ignite java 瘦客户端是否支持 Expired 条目事件类型的本地侦听器?
您需要使用
显式配置侦听EXPIRED
事件
query.setIncludeExpired(true)
根据JavaDoc:
Sets the flag value defining whether to notify about EventType.EXPIRED events. If true, then the remote listener will get notifications about entries expired in cache. Otherwise, only EventType.CREATED, EventType.UPDATED and EventType.REMOVED events will be fired in the remote listener. This flag is false by default, so EventType.EXPIRED events are disabled.