Hi, I am trying to implement StreamVisitor function inside service grid
execute function.I started ignite node and service deployment in the main
function, however, in the execute logic, there is no output message print
out. I tested the logic can be triggered when the StreamVisitor code is put
along with streamer, but there is no output inside the service grid
function.Any idea how I may be able to implement StreamVisitor inside
service grid?Thank you in advance.*In the main function:*TcpDiscoverySpi spi
= new TcpDiscoverySpi();TcpDiscoveryVmIpFinder ipFinder = new
TcpDiscoveryVmIpFinder();ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));spi.setIpFinder(ipFinder);IgniteConfiguration
cfg = new IgniteConfiguration();cfg.setDiscoverySpi(spi);// config
serviceServiceConfiguration svcCfg = new
ServiceConfiguration();svcCfg.setCacheName("realtime_data_cache");svcCfg.setName("realtime_data_cache");svcCfg.setMaxPerNodeCount(1);svcCfg.setTotalCount(1);svcCfg.setService(new
RemoteDataServiceImpl());System.out.println("------------step
0------------");cfg.setServiceConfiguration(svcCfg);Ignite ignite =
Ignition.start(cfg);ignite.getOrCreateCache("realtime_data_cache");IgniteDataStreamer<String,
RealtimeData> dataStreamer =
ignite.dataStreamer("realtime_data_cache");dataStreamer.autoFlushFrequency(10
* 1000);dataStreamer.allowOverwrite(true);// streamer data ingestion logic
here....*In the service impl.* @Override public void
execute(ServiceContext ctx) { stmr =
ignite.dataStreamer("realtime_data_cache"); while
(!ctx.isCancelled()) { stmr.receiver(new StreamVisitor<String,
RealtimeData>() { @Override public void
apply(IgniteCache<String, RealtimeData> cache, Map.Entry<String,
RealtimeData> e) { RealtimeData vo = JSON.parseObject(""
+ e.getValue(), RealtimeData.class); if (vo.getDelay() ==
0) { System.out.println(vo.getDelay() +
e.getValue()); } } }); }
}
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/