{"id":18554209,"url":"https://github.com/oracle/coherence-cpp-extend-client","last_synced_at":"2025-04-09T23:31:03.008Z","repository":{"id":37512064,"uuid":"243570817","full_name":"oracle/coherence-cpp-extend-client","owner":"oracle","description":"Coherence C++ client library","archived":false,"fork":false,"pushed_at":"2025-04-09T21:00:12.000Z","size":2755,"stargazers_count":12,"open_issues_count":0,"forks_count":10,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-09T22:19:07.950Z","etag":null,"topics":["caching","cloud","clustering","coherence","cpp","data-grid","distributed","hpc","imdg","in-memory","kv-store","microservices","polyglot","sanka","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:04:15.000Z","updated_at":"2025-04-04T04:32:17.000Z","dependencies_parsed_at":"2024-01-02T02:03:32.034Z","dependency_job_id":"55e356b6-b2e9-4c77-8091-cd4925f61a8b","html_url":"https://github.com/oracle/coherence-cpp-extend-client","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fcoherence-cpp-extend-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fcoherence-cpp-extend-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fcoherence-cpp-extend-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fcoherence-cpp-extend-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oracle","download_url":"https://codeload.github.com/oracle/coherence-cpp-extend-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248129575,"owners_count":21052597,"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","cpp","data-grid","distributed","hpc","imdg","in-memory","kv-store","microservices","polyglot","sanka","scalability"],"created_at":"2024-11-06T21:20:15.421Z","updated_at":"2025-04-09T23:30:57.996Z","avatar_url":"https://github.com/oracle.png","language":"C++","readme":"\u003c!--\n\n  Copyright (c) 2000, 2023, 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\u003cimg src=https://oracle.github.io/coherence/assets/images/logo-red.png\u003e\u003cimg\u003e\n\n[![CI Build](https://github.com/oracle/coherence-cpp-extend-client/workflows/CI%20Build/badge.svg?branch=main)](https://github.com/oracle/coherence-cpp-extend-client/actions?query=workflow%3A%22CI+Build%22+branch%3Amain)\n[![License](http://img.shields.io/badge/license-UPL%201.0-blue.svg)](https://oss.oracle.com/licenses/upl/)\n\n# Oracle Coherence for C++ Community Edition\n\n## Contents\n1. [Introduction to Coherence](#intro)\n1. [How to Get Coherence Community Edition](#acquire)\n1. [Introduction to Coherence for C++](#intro-cpp)\n1. [Building](#build)\n1. [CLI Hello Coherence Example](#cli-hello)\n1. [Programmatic Hello Coherence Example](#prog-hello)\n1. [Testing](#testing)\n1. [Documentation](https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/index.html)\n1. [Contributing](CONTRIBUTING.md)\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 `Map`\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 `NamedCache` (an extension of `Map`) 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/README.md).\n\n# \u003ca name=\"intro_cpp\"\u003e\u003c/a\u003eIntroduction to Coherence for C++\n\nCoherence for C++ allows C++ applications to access Coherence clustered services, including data,\ndata events, and data processing from outside the Coherence cluster. Typical uses of Coherence\nfor C++ include desktop and web applications that require access to Coherence caches.\n\nCoherence for C++ consists of a native C++ library that connects to a Coherence\\*Extend clustered\nservice instance running within the Coherence cluster using a high performance TCP/IP-based\ncommunication layer. This library sends all client requests to the Coherence\\*Extend clustered\nservice which, in turn, responds to client requests by delegating to an actual Coherence\nclustered service (for example, a partitioned or replicated cache service).\n\nA NamedCache instance is retrieved by using the `CacheFactory::getCache(...)` API call.\nAfter it is obtained, a client accesses the `NamedCache` in the same way as it would if it\nwere part of the Coherence cluster. The fact that `NamedCache` operations are being sent to a\nremote cluster node (over TCP/IP) is completely transparent to the client application.\n\n\u003e **_NOTE:_** The C++ client follows the interface and concepts of the Java client, and\n\u003e users familiar with Coherence for Java should find migrating to Coherence for C++ straightforward.\n\nSee [Developing Remote Clients for Oracle Coherence](https://docs.oracle.com/en/middleware/standalone/coherence/14.1.1.0/develop-remote-clients/creating-c-extend-clients.html)\nfor further details.\n\n# \u003ca name=\"build\"\u003e\u003c/a\u003eBuilding\n\n## Prerequisites\n\n1. A supported hardware platform and C++ compiler. See [Supported Environments for Coherence C++ Client](https://docs.oracle.com/en/middleware/standalone/coherence/14.1.1.0/install/installing-client-distribution.html#GUID-49C698DD-D34A-416D-A71C-566C32824CEA).\n1. Oracle Java 8 JDK\n1. Apache Ant version 1.7.0 or later\n1. [Ant-Contrib](http://ant-contrib.sourceforge.net/) version 1.0b3\n1. Ant-Contrib [cpptasks](http://ant-contrib.sourceforge.net/cpptasks/index.html) version 1.0b4\n\n## Building the shared library\n\nThe Coherence for C++ build system is based on Ant. To build Coherence for C++:\n\n1. Clone this repository\n1. Download Apache Ant version 1.7.0 or later and install it at `tools/internal/common/ant`\n1. Download ant-contrib-1.0b3.jar and install it at `tools/internal/common/ant-contrib/lib`\n1. Download cpptasks-1.0b4.jar and install it at `tools/internal/common/ant-contrib/lib`\n1. Set the `JAVA_HOME` environment variable to point to the Oracle JDK 8 home\n1. `cd bin`\n1. On unix flavor platforms source `cfglocal.sh` from a bash shell (e.g. `. cfglocal.sh`).  On windows open a Visual Studio native tools command prompt and run `cfgwindows.cmd`\n1. `cd ../prj/coherence`\n1. `ant -Dbuild.type=release clean build dist` - can take from 20 minutes to over an hour depending on platform type and CPU speed\n\nThe resulting files:\n\n* `dist/14.1.2.0.0b0/include` - the public header files\n* `dist/14.1.2.0.0b0/lib` - the Coherence for C++ shared library\n\n# \u003ca name=\"cli-hello\"\u003e\u003c/a\u003eCLI Hello Coherence Example\n\nThe following example illustrates starting a **storage enabled** Coherence Server,\nfollowed by a Coherence for C++ console application. Using the console, data is\ninserted and retrieved. The console is then terminated and restarted and data is once again\nretrieved to illustrate the permanence of the data.\n\n## Prerequisites\n\n1. The Coherence for C++ shared library see [Building](#build)\n1. [Coherence Community Edition](https://github.com/oracle/coherence) coherence.jar\n\n## Build Sanka\n\nSanka is a command line tool which can be used to run the `main` method on Coherence C++ classes\n\n1. Set the `JAVA_HOME` environment variable to point to the Oracle JDK 8 home\n1. `cd bin`\n1. On unix flavor platforms source `cfglocal.sh` from a bash shell (e.g. `. cfglocal.sh`).  On windows open a Visual Studio native tools command prompt and run `cfgwindows.cmd`\n1. `cd ../prj/sanka`\n1. `ant -Dbuild.type=release` build dist\n\n## Start a Coherence server\n\nUnix shell:\n\n```shell script\n$JAVA_HOME/bin/java -Dcoherence.pof.enabled=true -Dcoherence.log.level=6 -jar coherence.jar\n```\n\nWindows command prompt:\n\n```shell script\n\"%JAVA_HOME%/bin/java\" -Dcoherence.pof.enabled=true -Dcoherence.log.level=6 -jar coherence.jar\n```\n\n## Run the `coherence::net::CacheFactory::main()` (console) using sanka\n\nUnix shell:\n\n```shell script\ncd dist/14.1.2.0.0b0/bin\n./sanka -l ../lib/libcoherence.so coherence::net::CacheFactory\n````\n\nWindows command prompt:\n\n```shell script\n.\\sanka -l ..\\lib\\coherence.dll coherence::net::CacheFactory\n```\n\nConsole:\n\n```shell script\nMap (?): cache welcomes\n\nMap (welcomes): get english\nNULL\n\nMap (welcomes): put english Hello\nNULL\n\nMap (welcomes): put spanish Hola\nNULL\n\nMap (welcomes): put french Bonjour\nNULL\n\nMap (welcomes): get english\nHello\n\nMap (welcomes): list\nfrench = Bonjour\nenglish = Hello\nspanish = Hola\n\nMap (welcomes): bye\n```\n\nStart the console again\n\nUnix shell:\n\n```shell script\n./sanka -l ../lib/libcoherence.so coherence::net::CacheFactory\n```\n\nWindows command prompt:\n\n```shell script\n.\\sanka -l ..\\lib\\coherence.dll coherence::net::CacheFactory\n```\n\nConsole:\n\n```shell script\nMap (?): cache welcomes\n\nMap (welcomes): list\nfrench = Bonjour\nenglish = Hello\nspanish = Hola\n```\n\n# \u003ca name=\"prog-hello\"\u003e\u003c/a\u003eProgrammatic Hello Coherence Example\n\nThe following example illustrates starting a **storage enabled** Coherence server,\nfollowed by running the `HelloCoherence` application. The `HelloCoherence` application\ninserts and retrieves data from the Coherence server.\n\n## Prerequisites\n\n1. The Coherence for C++ shared library see [Building](#build)\n1. [Coherence Community Edition](https://github.com/oracle/coherence) coherence.jar\n\n## Build `HelloCoherence`\n\nCopy and paste the following source to a file named `HelloCoherence.cpp`:\n\n```c++\n#include \"coherence/lang.ns\"\n\n#include \"coherence/net/CacheFactory.hpp\"\n#include \"coherence/net/NamedCache.hpp\"\n#include \"coherence/util/Iterator.hpp\"\n\n#include \u003ciostream\u003e\n\nusing namespace coherence::lang;\n\nusing coherence::net::CacheFactory;\nusing coherence::net::NamedCache;\nusing coherence::util::Iterator;\n\nint main()\n    {\n    try\n        {\n        // access/create the \"welcomes\" cache in the Coherence cluster\n        NamedCache::Handle hCache = CacheFactory::getCache(\"welcomes\");\n        std::cout \u003c\u003c \"Accessing cache \\\"\" \u003c\u003c hCache-\u003egetCacheName()\n                  \u003c\u003c \"\\\" containing \" \u003c\u003c hCache-\u003esize() \u003c\u003c \" entries\"\n                  \u003c\u003c std::endl;\n\n        hCache-\u003eput(String::create(\"english\"), String::create(\"Hello\"));\n        hCache-\u003eput(String::create(\"spanish\"), String::create(\"Hola\"));\n        hCache-\u003eput(String::create(\"french\"), String::create(\"Bonjour\"));\n\n        // list\n        for (Iterator::Handle hIterator = hCache-\u003eentrySet()-\u003eiterator();\n             hIterator-\u003ehasNext(); )\n            {\n            std::cout \u003c\u003c hIterator-\u003enext() \u003c\u003c std::endl;\n            }\n\n        // disconnect from the Coherence cluster\n        CacheFactory::shutdown();\n        }\n    catch (const std::exception\u0026 e)\n        {\n        std::cerr \u003c\u003c \"error: \" \u003c\u003c e.what() \u003c\u003c std::endl;\n        return 1;\n        }\n    return 0;\n    }\n```\n\nCompile `HelloCoherence.cpp` using the Coherence for C++ header files and shared library:\n\nUsing GCC on Linux and macOS:\n\n```shell script\ng++ -Idist/14.1.2.0.0b0/include -lcoherence -L dist/14.1.2.0.0b0/lib -o HelloCoherence HelloCoherence.cpp\n```\n\nFrom a Visual Studio native tools command prompt on Windows:\n\n```shell script\ncl -Idist\\14.1.2.0.0b0\\include dist\\14.1.2.0.0b0\\lib\\coherence.lib -o HelloCoherence HelloCoherence.cpp\n```\n\n## Start a Coherence server\n\nUnix shell:\n\n```shell script\n$JAVA_HOME/bin/java -Dcoherence.pof.enabled=true -Dcoherence.log.level=6 -jar coherence.jar\n```\n\nWindows command prompt:\n\n```shell script\n\"%JAVA_HOME%/bin/java\" -coherence.pof.enabled=true -Dcoherence.log.level=6 -jar coherence.jar\n```\n\n## Run `HelloCoherence`\n\nUnix shell:\n\n```shell script\nexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:dist/14.1.2.0.0b0/lib\n./HelloCoherence\n```\n\nWindows command prompt:\n\n```shell script\nset PATH=%DEV_ROOT%\\dist\\14.1.2.0.0b0\\lib;%PATH%\nHelloCoherence\n```\n\n# \u003ca name=\"testing\"\u003e\u003c/a\u003eTesting\n\nCoherence for C++ has unit and functional tests to validate builds and code changes.\n\n## Prerequisites\n\n1. The Coherence for C++ shared library see [Building](#build)\n1. [Perl](https://www.perl.org/)\n1. Download [CxxTest](https://cxxtest.com/) version 3.10.1 and install it at `tools/internal/common/cxxtest`\n1. Comment out the `-Werror` flag in `prj/build-import.xml`\n(e.g. `\u003c!-- compilerarg if=\"cc.g++\" value=\"-Werror\"/ --\u003e`) as CxxTest source\nfiles will produce warnings when compiling with GCC\n\n## Building and running the tests\n\n1. Set the `JAVA_HOME` environment variable to point to the Oracle JDK 8 home\n1. `cd bin`\n1. On unix flavor platforms source `cfglocal.sh` from a bash shell (e.g. `. cfglocal.sh`).  On windows open a Visual Studio native tools command prompt and run `cfgwindows.cmd`\n\n```shell script\ncd ../prj/tests/unit (or cd ../prj/tests/functional)\nant -Dbuild.type=release build test\n```\n\n# Contributing\n\nInterested in contributing?  See our contribution [guidelines](CONTRIBUTING.md) for details.\n\n# Security\n\nPlease consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle%2Fcoherence-cpp-extend-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foracle%2Fcoherence-cpp-extend-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle%2Fcoherence-cpp-extend-client/lists"}