Question

In GridGain 6, can I obtain GridStreamer instance on remote node and use it to addEvents?

The idea is that I need a node, which can generate data for stream processing, but not to participate in processing itself.

All nodes, launched with StreamConfiguration section automatically participate in processing of events. And if node is launched without StreamConfiguration section - then its Grid instance don't see other streamers.

GridClient seems don't support streaming

Was it helpful?

Solution

You cannot get streamer instance on node which does not have this particular streamer configured. However, you can easily achieve your requirement by providing GridStreamerEventRouter that will not route events on nodes which are not supposed to participate in event processing.

For example, you can use random event router with predicate which will filter nodes by user attribute (you can set user attributes for a node with GridConfiguration.setUserAttributes(...)):

GridStreamerConfiguration streamCfg = new GridStreamerConfiguration();
//...
streamCfg.setRouter(new GridStreamerRandomEventRouter(new GridPredicate<GridNode>() {
    @Override public boolean apply(GridNode node) {
        return !"CLIENT".equals(node.attribute("STREAMER_ROLE"));
    }
}));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top