Neo4j 订阅 Python 中的数据库更改

Neo4j subscribe to DB changes in Python

有 2 个微服务,一个使用条目队列将数据插入数据库,另一个进行一些复杂的计算并根据此计算创建节点之间的关系。

我不想使用 REST API、websocket 等调用第一个微服务中的第二个微服务,而是只想订阅第二个微服务中的数据库更改。是否有插件、库等来订阅 Python 中的 neo4j 数据库更改?

Neo4j Streams 具有更改数据捕获功能,可将数据库更改流式传输到 Kafka。 https://neo4j.com/labs/kafka/4.0/producer/. If you don't want to use Kafka, you have the option to use APOC triggers, but they are not as mature as kafka IMO. https://neo4j.com/labs/apoc/4.1/background-operations/triggers/. However, you have the option to be very specific which changes do you want to listen for. Here's one example that does a request upon a trigger, but you would probably send a POST request somewhere: https://tbgraph.wordpress.com/2017/03/07/neo4j-apoc-triggers-and-web-apis/