Coder Social home page Coder Social logo

drieseng / hazelcast-csharp-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hazelcast/hazelcast-csharp-client

0.0 3.0 0.0 9.48 MB

Hazelcast IMDG .NET Client

Home Page: https://hazelcast.org/clients/net/

License: Apache License 2.0

C# 99.56% Batchfile 0.18% Shell 0.27%

hazelcast-csharp-client's Introduction

Hazelcast .Net Client

C# client implementation for Hazelcast, the open source in-memory data grid. A comparison of features supported by various clients can be found here.

It is implemented using the Hazelcast Open Binary Client Protocol

Getting Started

Installation

You can install .net client from NuGet Repo using PackageManager:

PM> Install-Package Hazelcast.Net

Net Core and .Net Framework Support

Hazelcast .Net Client supports .Net Framemork 4.0+ and Net Core 2.0+ .

Configuration

You can configure the Hazelcast .Net Client via API or XML. To start the client, you can pass a configuration or leave it empty to use default values.

For programatic configuration; please see Hazelcast.Config packege and related API doc.

For XML configuration; .Net Client uses the same XML schema of Hazelcast Java Client.

Sample client configuration:

var clientConfig = new ClientConfig();
clientConfig.GetNetworkConfig().AddAddress( "10.0.0.1" );
clientConfig.GetNetworkConfig().AddAddress( "10.0.0.2:5702" );

// Portable Serialization setup up 
clientConfig.GetSerializationConfig()
  .AddPortableFactory( MyPortableFactory.FactoryId, new MyPortableFactory() );

Starting the Client

After configuration, you can obtain a client using one of the static methods of Hazelcast, as shown below.

//client with default configuration
IHazelcastInstance defaultClient = HazelcastClient.NewHazelcastClient();

//client with custom configuration
IHazelcastInstance client = HazelcastClient.NewHazelcastClient(clientConfig);

//client configured from an xml configuration file 
IHazelcastInstance xmlConfClient = Hazelcast.NewHazelcastClient(@"..\Hazelcast.Net\Resources\hazelcast-client.xml");

Basic Usage

All distributed objects can be obtained from client IHazelcastInstance. An example for map is shown below:

var map = client.GetMap<string,string>("mapName");
map.Put("key", "value");

Please see Hazelcast.Examples project on this repo for various code samples.

Advanced Topics

Please refer to Hazelcast Reference Manual.

How to build

You can build the source by calling the batch file build.bat.

Strong name generation

Hazelcast assemblies are signed using a strong name key. To be able to build the project, you will need to create your own strong name key.

This can be done using the sn.exe tool which ships with .NET framework.

sn -k hazelcast.snk

Furthermore, you will need to update Hazelcast.Net/Properties/AssemblyInfo.cs with the new public key.

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Hazelcast.Test, PublicKey=00240000049e....b3")]

To get the new public key, use the following commands:

sn -p hazelcast.snk hazelcast.key
sn -tp hazelcast.key

How to run tests

All the tests use NUnit, and require a hazelcast.jar and JVM to run the hazelcast instance. The script build.bat will attempt to download hazelcast.jar for the latest snapshot from Maven Central and will run the tests using the downloaded jar.

Mail Group

Please join the mail group if you are interested in using or developing Hazelcast.

http://groups.google.com/group/hazelcast

License

Hazelcast is available under the Apache 2 License. Please see the Licensing appendix for more information.

Copyright

Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.

Visit www.hazelcast.com for more info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.