Skip to content

Commit 6ac2de4

Browse files
committed
Update subscriptions docs with 6.x changes
1 parent e863968 commit 6ac2de4

File tree

8 files changed

+44
-2529
lines changed

8 files changed

+44
-2529
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
** xref:subscriptions/getting-started.adoc[Getting started]
5151
** xref:subscriptions/events.adoc[Events]
5252
** xref:subscriptions/filtering.adoc[]
53-
** xref:subscriptions/scaling.adoc[]
54-
** xref:subscriptions/engines.adoc[Engines]
53+
** xref:subscriptions/customize-cdc.adoc[]
5554
5655
* *How-To*
5756
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[[customize-cdc]]
2+
= Customize CDC Subscriptions
3+
:page-aliases: subscriptions/plugins/index.adoc, subscriptions/plugins/amqp.adoc, subscriptions/plugins/single-instance.adoc
4+
:description: This page describes how to customize the behaviour of subscriptions.
5+
6+
== Neo4jGraphQLSubscriptionsCDCEngine
7+
8+
By default, the GraphQL library will use the same driver passed to `Neo4jGraphQL` to poll for events every second. This behaviour can be changed by creating a custom instance of `Neo4jGraphQLSubscriptionsCDCEngine`.
9+
10+
The following options can be passed to the constructor:
11+
12+
* `driver`: The driver to be used for CDC queries.
13+
* `pollTime`: The interval, in milliseconds, between queries to CDC.
14+
Defaults to 1000ms.
15+
Note that poll time is the period between one request finishing and the next one starting.
16+
The actual time it takes for CDC events to trigger the subscription also depend on your network.
17+
* `queryConfig`: An object with the driver query options to be passed to CDC requests.
18+
Use the `db` field to define the target database for CDC.
19+
20+
For example:
21+
22+
[source, javascript, indent=0]
23+
----
24+
import { Neo4jGraphQL, Neo4jGraphQLSubscriptionsCDCEngine } from '@neo4j/graphql';
25+
26+
const engine = new Neo4jGraphQLSubscriptionsCDCEngine({
27+
driver,
28+
pollTime: 5000
29+
})
30+
31+
const neoSchema = new Neo4jGraphQL({
32+
typeDefs,
33+
driver,
34+
features: {
35+
subscriptions: engine,
36+
},
37+
});
38+
----
39+

modules/ROOT/pages/subscriptions/engines.adoc

Lines changed: 0 additions & 221 deletions
This file was deleted.

0 commit comments

Comments
 (0)