hi,

how i can subscribe to just 1 object? The documentation is not clear about
how to create Remote Filters/Scan Filters. Below is is my code. i just need
to be notified to 1 particular object(id = 1), not all.



using Apache.Ignite.Core;
using Apache.Ignite.Core.Binary;
using Apache.Ignite.Core.Cache.Event;
using Apache.Ignite.Core.Cache.Query;
using Apache.Ignite.Core.Cache.Query.Continuous;
using Apache.Ignite.Core.Client;
using Apache.Ignite.Core.Client.Cache;
using Apache.Ignite.Core.Discovery.Tcp;
using Apache.Ignite.Core.Discovery.Tcp.Static;
using Apache.Ignite.Core.Events;
using System;
using System.Collections.Generic;
using System.Linq;

namespace test_console
{

    class Program
    {
        private class Listener<T> : ICacheEntryEventListener<int, T>
        {
            public void OnEvent(IEnumerable<ICacheEntryEvent&lt;int, T>>
events)
            {
                foreach (var e in events)
                    Console.WriteLine("Queried entry [key=" + e.Key + ",
val=" + e.Value + ']');
            }
        }

        static void Main(string[] args)
        {
            Ignition.ClientMode = true;
            using (var ignite =
Ignition.Start(@"C:\apache_ignite\examples\config\example-ignite.xml"))
            {
                var persons = ignite.GetCache<int,
IBinaryObject>("City").WithKeepBinary<int, IBinaryObject>();
                var localListener = new Listener<IBinaryObject>();
                var qry = new ContinuousQuery<int,
IBinaryObject>(localListener);

                var query = new SqlQuery("City",  "select * from City where
id = 1");
            

                var queryHandle = persons.QueryContinuous(qry, query);
                foreach (var entry in queryHandle.GetInitialQueryCursor())
                    Console.WriteLine("key={0}, val={1}", entry.Key,
entry.Value);
                Console.ReadLine();
            }
            
                
        }
    }
}



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

Reply via email to