Continuous Query supports both local and remote cache events, in .NET too.
Try it - create two simple programs and run them both:
// Program 1:
var ignite = Ignition.Start();
var cache = ignite.GetOrCreateCache<int, string>("cache-name");
for (var i = 0; i < int.MaxValue; i++)
{
Console.WriteLine($"Adding {i}");
cache[i] = $"Hello {i}!";
Thread.Sleep(500);
}
// Program 2:
var ignite = Ignition.Start();
var cache = ignite.GetOrCreateCache<int, string>("cache-name");
cache.QueryContinuous(new ContinuousQuery<int, string>(new
EventListener()));
Console.ReadKey();
class EventListener : ICacheEntryEventListener<int, string>
{
public void OnEvent(IEnumerable<ICacheEntryEvent<int, string>>
evts)
{
foreach (var evt in evts)
{
Console.WriteLine(evt.Value);
}
}
}
On Wed, Jan 20, 2021 at 1:15 AM Jigna <[email protected]> wrote:
> Hi,
>
> Now I am writing continuous queries for my scenario and I want to listen
> server node events as per my requirement.
>
> Ignite .net API does not support listening for remote events.
>
> As per my understanding, I have server node, which generates all the cache
> events. So, when I write continuous query, I need to write it in a separate
> application, it will start as a client node and listen the events using
> local listener(client node events). But, I want to listen the remote
> events(server node events) in the continuous query application.
>
> I am not sure how to support remote event listening in .net Ignite
> application. Would you please verify my understanding?
>
> I am not sure about my solution. Please suggest me how to write continuous
> query and listen server cache events in .Net Ignite application.
>
> Thank you,
> Jigna
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>