{"id":18554285,"url":"https://github.com/oracle/coherence-dotnet-extend-client","last_synced_at":"2025-04-09T23:31:10.345Z","repository":{"id":49806869,"uuid":"243571099","full_name":"oracle/coherence-dotnet-extend-client","owner":"oracle","description":"Coherence .NET client library","archived":false,"fork":false,"pushed_at":"2025-04-09T20:43:12.000Z","size":2892,"stargazers_count":13,"open_issues_count":2,"forks_count":12,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-09T21:37:56.251Z","etag":null,"topics":["caching","cloud","clustering","coherence","data-grid","distributed","dotnet","hpc","imdg","in-memory","kv-store","microservices","polyglot","scalability"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"upl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oracle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-27T17:05:23.000Z","updated_at":"2025-04-08T15:28:13.000Z","dependencies_parsed_at":"2024-02-07T17:27:17.310Z","dependency_job_id":"c60b2d21-8552-4fe6-b919-988e7e01811b","html_url":"https://github.com/oracle/coherence-dotnet-extend-client","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fcoherence-dotnet-extend-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fcoherence-dotnet-extend-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fcoherence-dotnet-extend-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fcoherence-dotnet-extend-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oracle","download_url":"https://codeload.github.com/oracle/coherence-dotnet-extend-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248129610,"owners_count":21052605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caching","cloud","clustering","coherence","data-grid","distributed","dotnet","hpc","imdg","in-memory","kv-store","microservices","polyglot","scalability"],"created_at":"2024-11-06T21:21:03.296Z","updated_at":"2025-04-09T23:31:05.335Z","avatar_url":"https://github.com/oracle.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\n  Copyright (c) 2000, 2024, Oracle and/or its affiliates.\n\n  Licensed under the Universal Permissive License v 1.0 as shown at\n  https://oss.oracle.com/licenses/upl.\n\n--\u003e\n\n-----\n\u003cimg src=https://oracle.github.io/coherence/assets/images/logo-red.png\u003e\u003cimg\u003e\n\n![CI Build](https://github.com/oracle/coherence-dotnet-extend-client/workflows/CI%20Build/badge.svg)\n[![License](http://img.shields.io/badge/license-UPL%201.0-blue.svg)](https://oss.oracle.com/licenses/upl/)\n\n# Oracle Coherence for .NET - Community Edition\n\n## Contents\n1. [Introduction to Coherence](#intro)\n1. [How to Get Coherence Community Edition](#acquire)\n1. [Getting Started](#getting-started)\n1. [Building](#build)\n1. [CLI Hello Coherence Example](#started)\n1. [Testing](#testing)\n1. [Documentation](#documentation)\n1. [Contributing](#contributing)\n\n## \u003ca name=\"intro\"\u003e\u003c/a\u003eIntroduction to Coherence\n\n[Coherence](http://coherence.community/) is a scalable, fault-tolerant, cloud-ready,\ndistributed platform for building grid-based applications and reliably storing data.\nThe product is used at scale, for both compute and raw storage, in a vast array of \nindustries such as critical financial trading systems, high performance telecommunication\nproducts and eCommerce applications. \n\nTypically these deployments do not tolerate any downtime and Coherence is chosen due to its \nnovel features in death detection, application data evolvability, and the robust,\nbattle-hardened core of the product that enables it to be seamlessly deployed and \nadapted within any ecosystem.\n\nAt a high level, Coherence provides an implementation of the familiar `IDictionary`\ninterface but rather than storing the associated data in the local process it is partitioned\n(or sharded) across a number of designated remote nodes. This partitioning enables\napplications to not only distribute (and therefore scale) their storage across multiple\nprocesses, machines, racks, and data centers but also to perform grid-based processing\nto truly harness the CPU resources of the machines. \n\nThe Coherence interface `INamedCache` (an extension of `IDictionary`) provides methods\nto query, aggregate (map/reduce style) and compute (send functions to storage nodes\nfor locally executed mutations) the data set. These capabilities, in addition to \nnumerous other features, enable Coherence to be used as a framework for writing robust,\ndistributed applications.\n\n## \u003ca name=\"acquire\"\u003e\u003c/a\u003eHow to Get Coherence Community Edition\n\nFor more details on how to obtain and use Coherence, please see the Coherence CE [README](https://github.com/oracle/coherence/tree/main/README.md).\n\n## Getting Started\n\nCoherence for .NET allows .NET applications to access Coherence clustered services, including data, data events, and data processing from outside the Coherence cluster. Typical uses of Coherence for .NET include desktop and web applications that require access to Coherence caches.\n\nCoherence for .NET consists of a lightweight .NET library that connects to a Coherence clustered service instance running within the Coherence cluster using a high performance TCP/IP-based communication layer. This library sends all client requests to the Coherence clustered proxy service which, in turn, responds to client requests by delegating to an actual Coherence clustered service (for example, a Partitioned or Replicated cache service).\n\nSee the [documentation](#documentation) for details on building Coherence applications using .NET.\n\n## \u003ca name=\"build\"\u003e\u003c/a\u003eBuilding\n\n### Prerequisites and Dependencies\n\n1. Microsoft .NET 6.0 or higher runtime and SDK\n2. Microsoft Visual Studio 2022+, or Visual Studio Code with the NET plugin installed is required to build\n\nThe Coherence for .NET also depends on [docfx](https://dotnet.github.io/docfx/) to build documentation.\n\nThe following additional dependencies are required for testing:\n1. Java 17 or later\n\nTo build Coherence for .NET, you must run the dotnet build utility, passing in the desired target that you would like to execute.\nUsing .NET 6, the output from the build is located in the `src/\u003cproject\u003e/bin/\u003cDebug|Release\u003e/net6.0` subdirectory.\nUsing .NET 8, the output from the build is located in the `src/\u003cproject\u003e/bin/\u003cDebug|Release\u003e/net8.0` subdirectory.\n\nTo build Coherence clone this repository and run the following commands:\n\nFor debug build run:\n```\ndotnet build\n```\nThe resulting files:\n\n`src/Coherence/bin/Debug/net6.0/Coherence.dll`\n`src/Coherence.SessionStore/bin/Debug/net6.0/Coherence.SessionStore.dll`\n\nFor release build run:\n```\ndotnet build --configuration Release\n```\nThe resulting files:\n\n`src/Coherence/bin/Release/net6.0/Coherence.dll`\n`src/Coherence.SessionStore/bin/Release/net6.0/Coherence.SessionStore.dll`\n\n`src/Coherence/bin/Release/Coherence.14.1.2.nupkg` - nuget package\n\nTo clean all build artifacts from your build system, run the following\ncommand:\n\n```\ndotnet clean\n```\n\n## \u003ca name=\"started\"\u003e\u003c/a\u003eCLI Hello Coherence Example\nThe following example illustrates starting a storage enabled Coherence server, followed by running the HelloCoherence console application. The HelloCoherence application inserts and retrieves data from the Coherence server.\n\n### Build HelloCoherence\n1. Using dotnet-cli to create a HelloCoherence console application:\n```\ndotnet new console --name \"HelloCoherence\"\n```\n1. Add the following references to the HelloCoherence.csproj (provide the Coherence.dll location in the `\u003cHintPath\u003e`):\n```\n  \u003cItemGroup\u003e\n    \u003cReference Include=\"Coherence, Version=14.1.2.0, Culture=neutral, PublicKeyToken=0ada89708fdf1f9a, processorArchitecture=MSIL\"\u003e\n      \u003cHintPath\u003eCoherence.dll\u003c/HintPath\u003e\n    \u003c/Reference\u003e\n    \u003cPackageReference Include=\"Common.Logging\" Version=\"3.4.1\" /\u003e\n    \u003cPackageReference Include=\"Microsoft.Extensions.Configuration\" Version=\"6.0.0\" /\u003e\n    \u003cPackageReference Include=\"Microsoft.Extensions.Configuration.Json\" Version=\"6.0.0\" /\u003e\n    \u003cPackageReference Include=\"System.Configuration.ConfigurationManager\" Version=\"6.0.1\" /\u003e\n  \u003c/ItemGroup\u003e\n```\nAlso include any Coherence configuration files you may have.\n\n1. Replace Program.cs code with the following source:\n```\n/*\n * Copyright (c) 2000, 2024, Oracle and/or its affiliates.\n *\n * Licensed under the Universal Permissive License v 1.0 as shown at\n * https://oss.oracle.com/licenses/upl.\n */\nusing System;\nusing Tangosol.Net;\nusing Tangosol.Net.Cache;\nusing Tangosol.Run.Xml;\nnamespace Hello\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // Display title as the C# console Coherence app and\n            // show user the valid commands:\n            Console.WriteLine(\"Coherence for .NET Extend Client\");\n            Console.WriteLine(\"The following are the available cache operations:\");\n            Console.WriteLine(\"\\tcache \u003ccacheName\u003e - specify a cache name to use\");\n            Console.WriteLine(\"\\tput \u003ckey\u003e \u003cvalue\u003e - put a \u003ckey, value\u003e pair into the cache\");\n            Console.WriteLine(\"\\tget \u003ckey\u003e - get the value of a given key from the cache\");\n            Console.WriteLine(\"\\tremove \u003ckey\u003e - remove an entry of the given key from the cache\");\n            Console.WriteLine(\"\\tlist - list all the entries in the cache\");\n            Console.WriteLine(\"\\tsize - get the size of the cache\");\n            Console.WriteLine(\"\\tbye - exit the console\");\n            Console.WriteLine();\n            Console.Write(\"Map (?): \");\n\n            // Declare variabs.\n            String      cacheName  = null;\n            INamedCache namedCache = null;\n            String      op         = Console.ReadLine().ToLower();\n            String[]    opList     = op.Split();\n\n            // Processing cache operations.\n            while (opList[0].CompareTo(\"bye\") != 0)\n            {\n                String key;\n                String value;\n\n                if (!opList[0].Equals(\"cache\") \u0026\u0026 namedCache == null)\n                {\n                    Console.WriteLine(\"No named cache.  Please specify a named cache to use.\");\n                }\n                else\n                {\n                    switch (opList[0])\n                    {\n                        case \"cache\":\n\t\t\t\t\t\t    if (opList.Length \u003c 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tConsole.WriteLine(\"No cache name.  Please specify a cache name to use.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcacheName = opList[1];\n\t\t\t\t\t\t\t\tnamedCache = CacheFactory.GetCache(cacheName);\n\t\t\t\t\t\t\t}\n                            break;\n\n                        case \"put\":\n\t\t\t\t\t\t    if (opList.Length \u003c 3)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tConsole.WriteLine(\"No key/value pair.  Please specify the key and value to be put into the cache.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey = opList[1];\n\t\t\t\t\t\t\t\tvalue = opList[2];\n\t\t\t\t\t\t\t\tnamedCache[key] = value;\n\t\t\t\t\t\t\t}\n                            break;\n\n                        case \"get\":\n\t\t\t\t\t\t    if (opList.Length \u003c 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tConsole.WriteLine(\"No key.  Please specify the key to get.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey = opList[1];\n\t\t\t\t\t\t\t\tvar result = namedCache[key];\n\t\t\t\t\t\t\t\tConsole.WriteLine(result == null ? \"NULL\" : namedCache[key]);\n\t\t\t\t\t\t\t}\n                            break;\n\n                        case \"remove\":\n\t\t\t\t\t\t    if (opList.Length \u003c 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tConsole.WriteLine(\"No key.  Please specify the key to remove.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey = opList[1];\n\t\t\t\t\t\t\t\tnamedCache.Remove(key);\n\t\t\t\t\t\t\t}\n                            break;\n\n                        case \"list\":\n                            foreach (ICacheEntry entry in namedCache.Entries)\n                            {\n                                Console.WriteLine(entry.Key + \" = \" + entry.Value);\n                            }\n                            break;\n\n                        case \"size\":\n                            Console.WriteLine(namedCache.Count);\n                            break;\n\n                        default:\n                            Console.WriteLine(\"Valid operations are: cache, put, get, remove, list, size, and bye.\");\n                            break;\n                    }\n                }\n\n                Console.WriteLine(\"\");\n                if (namedCache == null)\n                {\n                    Console.Write(\"Map (?): \");\n                }\n                else\n                {\n                    Console.Write(\"Map (\" + cacheName + \"): \");\n                }\n\n                // Read cache operation\n                op = Console.ReadLine().ToLower();\n                opList = op.Split();\n            }\n        }\n    }\n}\n```\n\nBy default, you need to provide a POF configure file, pof-config.xml, in the TargetFramework directory. Below are a sample pof-config.xml file:\n\n```\n\u003c?xml version=\"1.0\"?\u003e\n\u003c!--\n  Copyright (c) 2000, 2020, Oracle and/or its affiliates.\n\n  Licensed under the Universal Permissive License v 1.0 as shown at\n  https://oss.oracle.com/licenses/upl.\n--\u003e\n\u003cpof-config xmlns=\"http://schemas.tangosol.com/pof\"\u003e\n  \u003cuser-type-list\u003e\n    \u003c!-- include all \"standard\" Coherence POF user types --\u003e\n    \u003cinclude\u003eassembly://Coherence/Tangosol.Config/coherence-pof-config.xml\u003c/include\u003e\n\n    \u003c!-- include all application POF user types --\u003e\n  \u003c/user-type-list\u003e\n\u003c/pof-config\u003e\n```\n\n4. Build the HelloCoherence project\n```\ndotnet build\n```\n\n### Start a Coherence server\n\n```\n\"%JAVA_HOME%\\bin\\java\" -Dcoherence.pof.enabled=true -Dcoherence.log.level=9 -jar coherence.jar\n```\n\n### Run the Hello Coherence example\n\n```shell script\ndotnet run\n```\n\n```\nCoherence for .NET Extend Client\nThe following are the available cache operations:\n        cache \u003ccacheName\u003e - specify a cache name to use\n        put \u003ckey\u003e \u003cvalue\u003e - put a \u003ckey, value\u003e pair into the cache\n        get \u003ckey\u003e - get the value of a given key from the cache\n        remove \u003ckey\u003e - remove an entry of the given key from the cache\n        list - list all the entries in the cache\n        size - get the size of the cache\n        bye - exit the console\n\t\t\nMap (?): cache welcomes\n\nMap (welcomes): get english\nNULL\n\nMap (welcomes): put english hello\n\nMap (welcomes): put spanish hola\n\nMap (welcomes): put french bonjour\n\nMap (welcomes): get english\nHello\n\nMap (welcomes): list\nfrench = bonjour\nenglish = hello\nspanish = hola\n\nMap (welcomes): bye\n```\n\n```\ndotnet run\n```\n\n```\nCoherence for .NET Extend Client\nThe following are the available cache operations:\n        cache \u003ccacheName\u003e - specify a cache name to use\n        put \u003ckey\u003e \u003cvalue\u003e - put a \u003ckey, value\u003e pair into the cache\n        get \u003ckey\u003e - get the value of a given key from the cache\n        remove \u003ckey\u003e - remove an entry of the given key from the cache\n        list - list all the entries in the cache\n        size - get the size of the cache\n        bye - exit the console\n\t\t\nMap (?): cache welcomes\n\nMap (welcomes): list\nfrench = bonjour\nenglish = hello\nspanish = hola\n\nMap (welcomes): bye\n```\n\n### \u003ca name=\"testing\"\u003e\u003c/a\u003eTesting\n\nTo run Coherence for .NET test suite, first you must run a Coherence server. Go to tests/test-server folder and start server:\n\n```\ncd tests/test-server\nmvn clean package -Dcoherence.groupid=com.oracle.coherence.ce -Drevision=24.09 \u0026\u0026 mvn exec:exec -Dcoherence.groupid=com.oracle.coherence.ce -Drevision=24.09 -Dmain=com.tangosol.net.Coherence\n```\n\nTo run the test suite (excluding ASP.NET session tests that require the commercial edition of Coherence), use the following command:\n\n```\ndotnet test --filter FullyQualifiedName\\!~Tangosol.Web\n```\n\n## Documentation\n\nTo build Coherence for .NET API documentation, run the following command.  The API documentation can be viewed using Microsoft help viewer.\n```\ncd doc\ndocfx docfx.json\n```\n\nFor further details on developing Coherence for .NET applications, see the documentation [here](https://docs.oracle.com/en/middleware/standalone/coherence/14.1.2.0/develop-remote-clients/creating-net-extend-clients.html).\n\n## Contributing\n\nThis project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)\n\n## Security\n\nPlease consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process.\n\n## License\n\nCopyright (c) 2020, 2024 Oracle and/or its affiliates.\n\nReleased under the Universal Permissive License v1.0 as shown at\n\u003chttps://oss.oracle.com/licenses/upl/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle%2Fcoherence-dotnet-extend-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foracle%2Fcoherence-dotnet-extend-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle%2Fcoherence-dotnet-extend-client/lists"}