Apache Ignite.NET Documentation

The Apache Ignite .NET Developer Hub

Welcome to the Apache Ignite .NET developer hub. You'll find comprehensive guides and documentation to help you start working with Apache Ignite.NET as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Thin Client

Lightweight client connection

Thin Client is a lightweight Ignite connection mode. It does not start in JVM process (Java is not required at all), does not participate in cluster, never holds any data, or performs computations.

What it does is establish a socket connection to an individual Ignite node, and perform all operations through that node.

Thin Client mode is perfect for short-lived and resource-restricted applications, memory and CPU usage is minimal.

Installation

Thin client API is located in the same Apache.Ignite.Core assembly (Apache.Ignite NuGet package) and shares many classes and interfaces with full Ignite.NET API, so you can easily switch from one API to another. Basic installation procedure is the same: Getting Started.

Requirements

Even though assembly and NuGet package are the same, requirements are different:

  • Java is NOT required
  • Supported runtimes: .NET 4.0+, .NET Core 2.0+
  • Supported OS: Windows, Linux, macOS (any OS supported by .NET Core 2.0+)

Configuring Server Nodes

Thin client connector is enabled in Ignite server nodes by default. It can be disabled by setting IgniteConfiguration.ClientConnectorConfigurationEnabled to false in .NET, or IgniteConfiguration.clientConnectorConfiguration to null in Java or Spring XML.

Connector settings can be adjusted like this:

var cfg =  new IgniteConfiguration
{
    ClientConnectorConfiguration = new ClientConnectorConfiguration
    {
      Host = "myHost",
      MaxOpenCursorsPerConnection = 64,
      Port = 10900,
      PortRange = 50
    }
};
<igniteConfiguration>
  <clientConnectorConfiguration host='myHost' port='10900' portRange='50' maxOpenCursorsPerConnection='50' />  
</igniteConfiguration>
<bean  class="org.apache.ignite.configuration.IgniteConfiguration">
    <property name="clientConnectorConfiguration">
        <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration">
            <property name="host" value="myHost"/>
            <property name="port" value="11110"/>
            <property name="portRange" value="30"/>
        </bean>
    </property>
</bean>

Connecting to Cluster

The thin client API entry point is the Ignition.StartClient(IgniteClientConfiguration) method. The IgniteClientConfiguration.Host property is mandatory; it should point to a host where the Ignite server node is running. Other properties should correspond to ClientConnectorConfiguration of the server node.

Given that the server node runs locally, and ClientConnectorConfiguration is default:

var cfg = new IgniteClientConfiguration
{
  Host = "127.0.0.1"
};

using (IIgniteClient client = Ignition.StartClient(cfg))
{
  ICacheClient<int, string> cache = client.GetCache<int, string>("cache");
  cache.Put(1, "Hello, World!");
}

Authentication

User credentials must be provided if authentication is enabled on the server.

var cfg = new IgniteClientConfiguration
{
  Host = "127.0.0.1",
  Port = 10900,
  UserName = "ignite",
  Password = "kg1mmcoXZU"
};

using (IIgniteClient client = Ignition.StartClient(cfg))
{
  ICacheClient<int, string> cache = client.GetCache<int, string>("cache");
  cache.Put(1, "Hello, World!");
}

Thin Client APIs

Thin client offers a subset of full Ignite.NET APIs. It is evolving and we plan to support most APIs in both thick and thin clients in the future.

Current version supports Cache API ICacheClient, including ScanQuery with predicate.