ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murthy Kakarlamudi <ksa...@gmail.com>
Subject Ignite inside OData WebAPI
Date Fri, 23 Sep 2016 03:02:13 GMT
   I am trying to expose Cache contents as an Odata API. I created the
Odata API using ASP.NET WebAPI. Inside the API implementation, I am
initializing Ignite in cache mode. Below is the method I am using to
retrieve a listing. I have 2 questions.

1. I was not able to use Select option in AsCacheQueryable. How to get a
list of all the entries in the cache from LINQ?
2. Embedded IIS server quits the process after it hits var ignite =
Ignition.Start(cfg); statement. Processing stops beyond this statement. I
confirmed this in debug mode. It does not throw any errors in the console.
Not sure if it is possible to start Ignite in client mode in Web API that
is deployed on IIS.

Any help will be much appreciated. Thanks.

public List<Movie> GetMovies()
            var cfg = new IgniteConfiguration
                BinaryConfiguration = new
typeof(StarRating), typeof(Person)),
                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
            Ignition.ClientMode = true;
            var ignite = Ignition.Start(cfg);
            var cache = ignite.GetOrCreateCache<int, Movie>(new
                Name = "myMusicCache",
                QueryEntities = new[]
                        new QueryEntity(typeof(int), typeof(Movie))

            List<Movie> movies = new List<Movie>();
            IQueryable<ICacheEntry<int, Movie>> qry =
                cache.AsCacheQueryable().Where(m => m.Key == 1);

            foreach (ICacheEntry<int, Movie> entry in qry)
                Console.WriteLine("Movie: " + entry.Value);

            return movies;

View raw message