Hot Rod .NET/C# clients allow C# runtime applications to connect and interact with remote Infinispan clusters.

1. Installing and configuring the Hot Rod .NET/C# client

Install the Hot Rod .NET/C# client on Microsoft Windows systems where you use .NET Framework to interact with Infinispan clusters via the RemoteCache API.

1.1. Installing Hot Rod .NET/C# clients

Infinispan provides an installation package to install the Hot Rod .NET/C# client on Windows.

  • Any operating system on which Microsoft supports the .NET Framework

  • .NET Framework 4.6.2 or later

  • Windows Visual Studio 2015 or later

  1. Download the installation package for the Hot Rod .NET/C# from the Hot Rod client downloads.

  2. Launch the MSI installer for the Hot Rod .NET/C# client and follow the interactive wizard through the installation process.

1.2. Configuration and Remote Cache Manager APIs

Use the ConfigurationBuilder API to configure Hot Rod .NET/C# client connections and the RemoteCacheManager API to obtain and configure remote caches.

Basic configuration
using Infinispan.HotRod;
using Infinispan.HotRod.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace simpleapp
    class Program
        static void Main(string[] args)
            ConfigurationBuilder builder = new ConfigurationBuilder();
            // Connect to a server at localhost with the default port.
                .Host(args.Length > 1 ? args[0] : "")
                .Port(args.Length > 2 ? int.Parse(args[1]) : 11222);
            Configuration config = builder.Build();
            // Create and start a RemoteCacheManager to interact with caches.
            RemoteCacheManager remoteManager = new RemoteCacheManager(conf);
            IRemoteCache<string,string> cache=remoteManager.GetCache<string, string>();
            cache.Put("key", "value");
            Console.WriteLine("key = {0}", cache.Get("key"));
ConfigurationBuilder builder = new ConfigurationBuilder();
// Add a server with specific connection timeouts
// ConfigurationBuilder has fluent interface, options can be appended in chain.
// Enabling authentication with server name "node0",
// sasl mech "PLAIN", user "supervisor", password "aPassword", security realm "aRealm"
    .SaslMechanism("PLAIN").SetupCallback("supervisor", "aPassword", "aRealm");
Configuration c = conf.Build();
ConfigurationBuilder builder = new ConfigurationBuilder();
// Get configuration builder for encryption
SslConfigurationBuilder sslBuilder = conf.Ssl();
// Enable encryption and provide client certificate
// Provide server cert if server needs to be verified
Configuration c = conf.Build();
Cross-site failover
ConfigurationBuilder builder = new ConfigurationBuilder();
  // Configure a remote cluster and node when using cross-site failover.
  builder.AddCluster("nyc").AddClusterNode("", 11322);
Near caching
ConfigurationBuilder builder = new ConfigurationBuilder();
  // Enable near-caching for the client.