1
votes

I have a .Net console project referencing the Apache Ignite Nuget package. I'm interested in running the ignite-rest-http module within this same process. I'm using Apache Ignite 2.0.

I'm referring to the Apache Ignite REST Api as described here: https://apacheignite.readme.io/docs/rest-api

I've tried the "Getting Started":

To enable HTTP connectivity, make sure that ignite-rest-http module is in classpath. With binary distribution this means copying libs\optional\ignite-rest-http to libs\ignite-rest-http.

However, it didn't seem to work. I started my process and went to http://localhost:8080, but there was no response.

Is it appropriate to host the ignite-rest-http module within a .Net process?

If so, is there something else I need to configure in order to host the ignite-rest-http module in a .Net process?

1
Have you tried something from rest api? For example curl localhost:8080/ignite?cmd=version. Which http code you get in answer?Evgenii Zhuravlev

1 Answers

2
votes

NuGet package includes a limited set of JARs required for core functionality. Optional libs are not included (NuGet.org has 30 MB package size limit).

To enable ignite-rest-http with NuGet:

  • Download full binary package from https://ignite.apache.org/download.cgi#binaries
  • Extract libs\optional\ignite-rest-http contents somewhere, say c:\ignite-rest-http
  • Provide IgniteConfiguration.JvmClasspath property with ;-separated paths to all http JAR files

    var cfg = new IgniteConfiguration
    {
        JvmClasspath = Directory.GetFiles(@"c:\ignite-rest-http")
            .Aggregate((x, y) => x + ";" + y)
    };
    
    Ignition.Start(cfg);
    
    Console.WriteLine(new WebClient().DownloadString("http://localhost:8080/ignite?cmd=version"));
    

There are plans to include these JARs as a separate NuGet package: https://issues.apache.org/jira/browse/IGNITE-3275