{"id":13529709,"url":"https://github.com/graphaware/neo4j-changefeed","last_synced_at":"2025-04-01T17:30:47.892Z","repository":{"id":18214193,"uuid":"21350783","full_name":"graphaware/neo4j-changefeed","owner":"graphaware","description":"A GraphAware Framework Runtime Module allowing users to find out what were the latest changes performed on the graph","archived":true,"fork":false,"pushed_at":"2018-01-26T11:40:29.000Z","size":285,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-08-02T07:10:39.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphaware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-30T12:47:44.000Z","updated_at":"2023-01-28T09:08:44.000Z","dependencies_parsed_at":"2022-09-13T08:42:01.706Z","dependency_job_id":null,"html_url":"https://github.com/graphaware/neo4j-changefeed","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-changefeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-changefeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-changefeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-changefeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaware","download_url":"https://codeload.github.com/graphaware/neo4j-changefeed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222748072,"owners_count":17031894,"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":[],"created_at":"2024-08-01T07:00:38.730Z","updated_at":"2024-11-02T16:30:57.799Z","avatar_url":"https://github.com/graphaware.png","language":"Java","funding_links":[],"categories":["Extensions","REST API"],"sub_categories":["REST API","Other"],"readme":"GraphAware Neo4j ChangeFeed - RETIRED\n=====================================\n\nChangeFeed Has Been Retired\n---------------------------\n\nAs of March 26th 2016, this module is retiring. This means it will no longer be maintained and released together with\nnew versions of the GraphAware Framework and Neo4j. The last compatible Neo4j version is 2.3.2.\n\nChangeFeed is being replaced by a much more powerful Audit Module, which is part of \u003ca href=\"http://graphaware.com/enterprise/\"\u003eGraphAware Enterprise\u003c/a\u003e and is\navailable under a commercial subscription. Unlike many other GraphAware modules, nobody is using ChangeFeed in production, to the best of our knowledge.\n\nThis repository will remain public. Please \u003ca href=\"http://graphaware.com/contact/\"\u003eget in touch\u003c/a\u003e if you've been using ChangeFeed and would like to migrate to\nGraphAware Audit.\n\nIntroduction\n------------\n\n[![Build Status](https://travis-ci.org/graphaware/neo4j-changefeed.png)](https://travis-ci.org/graphaware/neo4j-changefeed) | \u003ca href=\"http://graphaware.com/site/changefeed/latest/apidocs/\" target=\"_blank\"\u003eJavadoc\u003c/a\u003e | Latest Release: 2.3.2.37.7\n\nGraphAware ChangeFeed is a [GraphAware](https://github.com/graphaware/neo4j-framework) Runtime Module that keeps track of changes made to the graph.\n\nGetting the Software\n--------------------\n\n### Server Mode\n\nWhen using Neo4j in the \u003ca href=\"http://docs.neo4j.org/chunked/stable/server-installation.html\" target=\"_blank\"\u003estandalone server\u003c/a\u003e mode,\nyou will need the \u003ca href=\"https://github.com/graphaware/neo4j-framework\" target=\"_blank\"\u003eGraphAware Neo4j Framework\u003c/a\u003e and GraphAware Neo4j ChangeFeed .jar files (both of which you can \u003ca href=\"http://graphaware.com/downloads/\" target=\"_blank\"\u003edownload here\u003c/a\u003e) dropped\ninto the `plugins` directory of your Neo4j installation. After a change in neo4.properties (described later) and Neo4j restart, you will be able to use the REST APIs of the ChangeFeed.\n\n### Embedded Mode / Java Development\n\nJava developers that use Neo4j in \u003ca href=\"http://docs.neo4j.org/chunked/stable/tutorials-java-embedded.html\" target=\"_blank\"\u003eembedded mode\u003c/a\u003e\nand those developing Neo4j \u003ca href=\"http://docs.neo4j.org/chunked/stable/server-plugins.html\" target=\"_blank\"\u003eserver plugins\u003c/a\u003e,\n\u003ca href=\"http://docs.neo4j.org/chunked/stable/server-unmanaged-extensions.html\" target=\"_blank\"\u003eunmanaged extensions\u003c/a\u003e,\nGraphAware Runtime Modules, or Spring MVC Controllers can include use the ChangeFeed as a dependency for their Java project.\n\n#### Releases\n\nReleases are synced to \u003ca href=\"http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22changefeed%22\" target=\"_blank\"\u003eMaven Central repository\u003c/a\u003e. When using Maven for dependency management, include the following dependency in your pom.xml.\n\n    \u003cdependencies\u003e\n        ...\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.graphaware.neo4j\u003c/groupId\u003e\n            \u003cartifactId\u003echangefeed\u003c/artifactId\u003e\n            \u003cversion\u003e2.3.2.37.7\u003c/version\u003e\n        \u003c/dependency\u003e\n        ...\n    \u003c/dependencies\u003e\n\n#### Snapshots\n\nTo use the latest development version, just clone this repository, run `mvn clean install` and change the version in the\ndependency above to 2.3.2.37.8-SNAPSHOT.\n\n#### Note on Versioning Scheme\n\nThe version number has two parts. The first four numbers indicate compatibility with Neo4j GraphAware Framework.\n The last number is the version of the ChangeFeed library. For example, version 2.1.2.10.2 is version 2 of the ChangeFeed\n compatible with GraphAware Neo4j Framework 2.1.2.10.\n\nSetup and Configuration\n=======================\n\n### Server Mode\n\nEdit neo4j.properties to register the ChangeFeed module:\n\n```\ncom.graphaware.runtime.enabled=true\n\n#CFM becomes the module ID:\ncom.graphaware.module.CFM.1=com.graphaware.module.changefeed.ChangeFeedModuleBootstrapper\n\n#optional, default is 100:\ncom.graphaware.module.CFM.maxChanges=100\n\n#optional, default is 10000 (10 seconds):\ncom.graphaware.module.CFM.pruneDelay=10000\n\n#optional, default is 10;\ncom.graphaware.module.CFM.pruneWhenExceeded=10\n\n#optionally specify node inclusion policy using expressions, default is all business (i.e. non-framework-internal) nodes\ncom.graphaware.module.CFM.node=!hasLabel('NotIncluded')\n\n#optionally specify relationship inclusion policy using expressions, default is all business (i.e. non-framework-internal) relationships\ncom.graphaware.module.CFM.relationship=!isType('NOT_INCLUDED')\n```\n\nNote that \"CFM\" becomes the module ID. It is possible to register the ChangeFeed module multiple times with different\nconfigurations, provided that their IDs are different. This ID is important for querying the feed (read on).\n\n`com.graphaware.module.CFM.maxChanges` limits the total number of changes tracked. The default is 100.\nNote that for efficiency, the total number of changes at any given point may be 10 (by default) more than the maxChanges\nset but will eventually constrain the size to 100. The default value can be changed by setting the `com.graphaware.module.CFM.pruneWhenExceeded`\nconfiguration value. Finally, `com.graphaware.module.CFM.pruneDelay` specifies in milliseconds, how frequently the changes\n will be checked for pruning. The default is 10 seconds.\n\n### Embedded Mode / Java Development\n\nTo use the ChangeFeed programmatically, register the module like this\n\n```java\n GraphAwareRuntime runtime = GraphAwareRuntimeFactory.createRuntime(database);  //where database is an instance of GraphDatabaseService\n ChangeFeedModule module = new ChangeFeedModule(\"CFM\", ChangeFeedConfiguration.defaultConfiguration(), database);\n runtime.registerModule(module);\n runtime.start();\n```\n\nAlternatively:\n```java\n GraphDatabaseService database = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(pathToDb)\n    .loadPropertiesFromFile(this.getClass().getClassLoader().getResource(\"neo4j.properties\").getPath())\n    .newGraphDatabase();\n\n RuntimeRegistry.getStartedRuntime(database);\n //make sure neo4j.properties contain the lines mentioned in previous section\n```\n\nUsing GraphAware ChangeFeed\n===========================\n\n### Server Mode\n\nIn Server Mode, the ChangeFeed is accessible via the REST API.\n\nYou can issue GET requests to `http://your-server-address:7474/graphaware/changefeed/{moduleId}` to get a list of changes\nmade to the graph, most recent change first. {moduleId} is the module ID the ChangeFeed Module was registered with. You\ncan omit this part of the URL, in which case \"CFM\" is assumed as the default value.\n\n Two parameters can be added to each request, `uuid` and `limit`, where `uuid` is the uuid of the last change set the client\n has already seen, so only changes later than the given one will be returned. `limit` is the maximum\n number of changes to return, most recent change first. A GET request using these parameters would be issued to the following\n URL: `http://your-server-address:7474/graphaware/changefeed/{moduleId}?uuid={uuid}\u0026limit={limit}`\n\nThe REST API returns a JSON array of changesets. A changeset contains the following:\n\n* uuid - the uuid of the changeset\n* timestamp - timestamp of the changeset (represented as the number of milliseconds since 1/1/1970)\n* changes - an array of Strings representing each modification to the graph that occurred in the same transaction\n\ne.g.\n```json\n[\n    {\n        \"uuid\": \"376de020-20b3-11e4-83b0-f0b4792288ef\",\n        \"timestamp\": 1405411937335,\n        \"changes\": [\n            \"Created node (:Person {name: Doe})\"\n        ]\n    },\n    {\n        \"uuid\": \"376de021-20b3-11e4-83b0-f0b4792288ef\",\n        \"timestamp\": 1405411933210,\n        \"changes\": [\n            \"Created node (:Person {name: John})\"\n        ]\n    }\n]\n```\n\n*NOTE*: Please note that timestamps are assigned at the instant when the transaction starts committing.\nConsequently, the order does not represent the order in which the transactions have been committed. \n\n### Java API\n\nTo use the Java API, please instantiate `CachingGraphChangeReader` and use one of its methods for getting the changes.\n\n```\nGraphChangeReader reader = new CachingGraphChangeReader(database);\nCollection\u003cChangeSet\u003e changes = reader.getAllChanges();\n```\n\nIn case more than one ChangeFeed Module is registered or a single one with ID different than \"CFM\" is registered, then\nthe ID must be specified when constructing the reader.\n\n```\nGraphChangeReader reader = new CachingGraphChangeReader(database, \"ModuleID\");\nCollection\u003cChangeSet\u003e changes = reader.getAllChanges();\n```\n\nPlease refer to Javadoc for more detail.\n\nLimitations\n-----------\n\nNote that Node IDs and Relationship IDs are not exposed by the change feed. This is a deliberate choice as it is not a\ngood practice to expose internal IDs outside of Neo4j. Please use custom identifiers (such as UUIDs) instead.\n\nAlso note that the contents of the changes are human-, rather than machine-readable. This will be changed in future\nversions.\n\nLicense\n-------\n\nCopyright (c) 2014 GraphAware\n\nGraphAware is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License\nas published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied\nwarranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program.\nIf not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-changefeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaware%2Fneo4j-changefeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-changefeed/lists"}