Skip to content

Commit 5500654

Browse files
authored
chore: restructure current Cosmo Streams docs (#188)
* chore: rebrand EDFS to Cosmo Streams * chore: split hooks into subpages + add OnReceiveEvents docs * chore: split hooks into subpages + add OnReceiveEvents docs * feat: add OnPublishEvent docs page * chore: rename to error handling, change order * chore: add docs for subscription start hook * chore: clean up Cosmo Streams overview * chore: change url to cosmo-streams and add redirects for old urls * fix: fix broken link * fix: rename remaining edfs references
1 parent fa3b614 commit 5500654

File tree

17 files changed

+916
-445
lines changed

17 files changed

+916
-445
lines changed

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ mintlify install
4242
- **Namespaces**: Environment isolation for graphs (dev, staging, prod)
4343
- **Feature Flags & Feature Subgraphs**: Toggle-able subgraph replacements for incremental rollout
4444
- **Schema Contracts**: Filtered graph versions using @tag directives
45-
- **EDFS**: Event-Driven Federated Subscriptions for real-time data
45+
- **Cosmo Streams / EDFS**: Event-Driven Federated Subscriptions for real-time data
4646

4747
## Documentation Structure
4848

docs/docs.json

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,30 @@
216216
]
217217
},
218218
{
219-
"group": "Event-Driven Federated Subscriptions (EDFS)",
220-
"icon": "calendar-users",
219+
"group": "Cosmo Streams (EDFS)",
220+
"icon": "wave",
221221
"pages": [
222-
"router/event-driven-federated-subscriptions-edfs",
222+
"router/cosmo-streams",
223223
{
224224
"group": "NATS",
225225
"icon": "puzzle-piece",
226226
"pages": [
227-
"router/event-driven-federated-subscriptions-edfs/nats",
228-
"router/event-driven-federated-subscriptions-edfs/nats/stream-and-consumer-configuration"
227+
"router/cosmo-streams/nats",
228+
"router/cosmo-streams/nats/stream-and-consumer-configuration"
229229
]
230230
},
231-
"router/event-driven-federated-subscriptions-edfs/kafka",
232-
"router/event-driven-federated-subscriptions-edfs/redis",
233-
"router/event-driven-federated-subscriptions-edfs/custom-modules"
231+
"router/cosmo-streams/kafka",
232+
"router/cosmo-streams/redis",
233+
{
234+
"group": "Custom Modules",
235+
"icon": "cubes",
236+
"pages": [
237+
"router/cosmo-streams/custom-modules",
238+
"router/cosmo-streams/custom-modules/subscription-on-start",
239+
"router/cosmo-streams/custom-modules/on-receive-event",
240+
"router/cosmo-streams/custom-modules/on-publish-event"
241+
]
242+
}
234243
]
235244
},
236245
"router/compliance-and-data-management",
@@ -738,5 +747,11 @@
738747
"gtm": {
739748
"tagId": "GTM-5GPL7DQH"
740749
}
741-
}
750+
},
751+
"redirects": [
752+
{
753+
"source": "/router/event-driven-federated-subscriptions-edfs/:path*",
754+
"destination": "/router/cosmo-streams/:path*"
755+
}
756+
]
742757
}

docs/federation/directives/openfed__subscriptionfilter.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ input openfed__SubscriptionFilterCondition {
2626

2727
## Overview
2828

29-
The `@openfed__subscriptionFilter` directive declares that a field definition can be filtered by filter conditions. The directive can only be applied to [EDFS](/federation/event-driven-federated-subscriptions) subscriptions.
29+
The `@openfed__subscriptionFilter` directive declares that a field definition can be filtered by filter conditions. The directive can only be applied to [EDG](/federation/event-driven-federated-subscriptions) subscriptions.
3030

3131
## Arguments
3232

docs/federation/event-driven-federated-subscriptions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ icon: circle-info
77

88
Defining an Event-Driven Graph with Event-Driven Federated Subscriptions.
99

10-
An Event-Driven Graph (EDG) is best thought to be an abstract subgraph that facilitates Event-Driven Federated Subscriptions (EDFS). If a subgraph uses or defines any event driven directives, it will be interpreted to be an Event-Driven Graph.
10+
An Event-Driven Graph (EDG) is best thought to be an abstract subgraph that facilitates [Cosmo Streams](/router/cosmo-streams). If a subgraph uses or defines any event driven directives, it will be interpreted to be an Event-Driven Graph.
1111

1212

docs/router/configuration.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ This option may change or be removed in future versions as the OpenTelemetry SDK
611611
| METRICS_OTLP_EXCLUDE_METRIC_LABELS | exclude_metric_labels | <Icon icon="square" /> | The metric labels to exclude from the OTEL metrics. Accepts a list of Go regular expressions. Use https://regex101.com/ to test your regular expressions. | [] |
612612
| METRICS_OTLP_CONNECTION_STATS | connection_stats | <Icon icon="square" /> | Enable connection metrics. | false |
613613
| METRICS_OTLP_CIRCUIT_BREAKER | circuit_breaker | <Icon icon="square" /> | Ensure that circuit breaker metrics are enabled for OTEL. | false |
614-
| METRICS_OTLP_STREAM | streams | <Icon icon="square" /> | Enable EDFS stream metrics. | false |
614+
| METRICS_OTLP_STREAM | streams | <Icon icon="square" /> | Enable Cosmo Streams metrics. | false |
615615

616616
### Attributes
617617

@@ -662,7 +662,7 @@ telemetry:
662662
| PROMETHEUS_EXCLUDE_METRIC_LABELS | exclude_metric_labels | <Icon icon="square" /> | | |
663663
| PROMETHEUS_EXCLUDE_SCOPE_INFO | exclude_scope_info | <Icon icon="square" /> | Exclude scope info from Prometheus metrics. | false |
664664
| PROMETHEUS_CIRCUIT_BREAKER | circuit_breaker | <Icon icon="square" /> | Enable the circuit breaker metrics for prometheus metric collection. | false |
665-
| PROMETHEUS_OTLP_STREAM | streams | <Icon icon="square" /> | Enable EDFS stream metrics. | false |
665+
| PROMETHEUS_OTLP_STREAM | streams | <Icon icon="square" /> | Enable Cosmo Streams metrics. | false |
666666

667667
### Example YAML config:
668668

docs/router/event-driven-federated-subscriptions-edfs.mdx renamed to docs/router/cosmo-streams.mdx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: "Event-Driven Federated Subscriptions (EDFS)"
3-
description: "EDFS combines the power of GraphQL Federation and Event-Driven Architecture (Kafka, NATS, Redis) to update a user GraphQL Subscription after an event occurs in your system."
2+
title: "Cosmo Streams (EDFS)"
3+
description: "Cosmo Streams (formally known as EDFS) combines the power of GraphQL Federation and Event-Driven Architecture to update a user GraphQL Subscription after an event occurs in your system."
44
icon: "circle-info"
55
sidebarTitle: "Overview"
66
---
@@ -9,7 +9,7 @@ sidebarTitle: "Overview"
99
![](/images/router/EDFS.png)
1010
</Frame>
1111

12-
Event Driven Federated Subscriptions (EDFS) solves 3 major problems when it comes to GraphQL Federation and Subscriptions by directly connecting the Router to an event source like Kafka and NATS and making it a part of the Graph.
12+
Cosmo Streams solves 3 major problems when it comes to GraphQL Federation and Subscriptions by directly connecting the Router to an event source like Kafka and NATS and making it a part of the Graph.
1313

1414
## Intro
1515

@@ -38,18 +38,18 @@ Furthermore, classic Subscriptions with Federation are quite expensive when it c
3838

3939
## Specification
4040

41-
Enter Event-Driven Federated Subscriptions, a simple way to scale Federated Subscriptions in a resource-efficient manner.
41+
Enter Cosmo Streams, a simple way to scale Federated Subscriptions in a resource-efficient manner.
4242

43-
EDFS supports three event providers:
43+
Cosmo Streams supports three event providers:
4444

4545
<CardGroup cols={3}>
46-
<Card title="Kafka" icon="sitemap" href="/router/event-driven-federated-subscriptions-edfs/kafka">
46+
<Card title="Kafka" icon="sitemap" href="/router/cosmo-streams/kafka">
4747

4848
</Card>
49-
<Card title="NATS" icon="puzzle-piece" href="/router/event-driven-federated-subscriptions-edfs/nats">
49+
<Card title="NATS" icon="puzzle-piece" href="/router/cosmo-streams/nats">
5050

5151
</Card>
52-
<Card title="Redis" icon="memory" href="/router/event-driven-federated-subscriptions-edfs/redis">
52+
<Card title="Redis" icon="memory" href="/router/cosmo-streams/redis">
5353

5454
</Card>
5555
</CardGroup>
@@ -58,7 +58,7 @@ Each provider consists of at least Publish and Subscribe capabilities. For NATS,
5858

5959
Our goal is to integrate with various technologies rather than agree on a single unified interface. This approach allows us to leverage the strengths of each technology. This philosophy is reflected in how we structure the directives, naming parameters, exposing features as they would appear in their respective ecosystems.
6060

61-
Here is an overview about all EDFS directives:
61+
Here is an overview about all Cosmo Streams directives:
6262

6363
```js
6464
# Nats and JetStream integration
@@ -120,7 +120,7 @@ An Event-Driven Subgraph does not need to be implemented. It is simply a Subgrap
120120

121121
## Prerequisites
122122

123-
To use EDFS, you need to have an Event Source running and connected to the Router. Currently, we support NATS, Kafka, and Redis. For simplicity, NATS is used to explain the examples.
123+
To use Cosmo Streams, you need to have an Event Source running and connected to the Router. Currently, we support NATS, Kafka, and Redis. For simplicity, NATS is used to explain the examples.
124124

125125
To get started, run a NATS instance and add the following configuration to your `config.yaml` Router Configuration:
126126

@@ -315,7 +315,7 @@ Here's an **invalid** message as the `__typename` field is missing:
315315

316316
</CodeGroup>
317317

318-
It's important to send the `__typename` field because this allows EDFS to also work for Union and Interface types.
318+
It's important to send the `__typename` field because this allows Cosmo Streams to also work for Union and Interface types.
319319

320320
It's worth noting that the Router will not send any responses before you publish a message on the topic. If you need the most recent result, first make a Query, and then subscribe to the Topic. The Router will send the first response only after a message is published on the rendered topic.
321321

@@ -437,11 +437,11 @@ The Cosmo Router deduplicates Subscriptions internally to save resources. If mul
437437

438438
### Statelessness of Subgraphs
439439

440-
With EDFS, the Router connects directly to the Event Source but doesn't require any stateful connections, e.g. WebSocket, to the Subgraphs. This makes the Subgraphs much simpler to reason about and easier to deploy. Serverless deployment options usually have limitations on request length. With an Event Broker in the middle, Subgraphs can be stateless without having to give up on Subscriptions.
440+
With Cosmo Streams, the Router connects directly to the Event Source but doesn't require any stateful connections, e.g. WebSocket, to the Subgraphs. This makes the Subgraphs much simpler to reason about and easier to deploy. Serverless deployment options usually have limitations on request length. With an Event Broker in the middle, Subgraphs can be stateless without having to give up on Subscriptions.
441441

442442
### Efficiency, CPU & Memory Consumption (Epoll/Kqueue)
443443

444-
EDFS is built on top of Event-Driven principles, which means that the implementation is non-blocking, as CPU efficient as possible, and has a very low memory footprint.
444+
Cosmo Streams is built on top of Event-Driven principles, which means that the implementation is non-blocking, as CPU efficient as possible, and has a very low memory footprint.
445445

446446
We're using Epoll and Kqueue on Systems that support it (Linux, Darwin, etc.) to be as efficient as possible.
447447

@@ -451,10 +451,10 @@ The Router supports multi-core out of the box and is capable of scaling up to a
451451

452452
### Publish Events from any System, not just Subgraphs
453453

454-
It's worth noting that publishing Entity update Events is not limited to just Subgraphs. EDFS is designed to fully decouple the API Consumer from the implementation of the Event-Driven Architecture.
454+
It's worth noting that publishing Entity update Events is not limited to just Subgraphs. Cosmo Streams is designed to fully decouple the API Consumer from the implementation of the Event-Driven Architecture.
455455

456-
A client can create a Job via a Mutation and Subscribe to the Job state via EDFS. Next, the Mutation can kick off a long-running process that will be handled by one or many systems in the background. At each step, e.g. when an increment of work is done, each subsystem can publish a message to indicate that the state of an Entity has changed.
456+
A client can create a Job via a Mutation and Subscribe to the Job state via Cosmo Streams. Next, the Mutation can kick off a long-running process that will be handled by one or many systems in the background. At each step, e.g. when an increment of work is done, each subsystem can publish a message to indicate that the state of an Entity has changed.
457457

458458
Once the message is published by one of the sub-systems, the Router can Query all Subgraphs to resolve the current state of the Job.
459459

460-
With EDFS, each Subgraph can add fields to an Entity that it's responsible for and publish events to the Message Broker when a long-running Operation updates the overall state of an Entity.
460+
With Cosmo Streams, each Subgraph can add fields to an Entity that it's responsible for and publish events to the Message Broker when a long-running Operation updates the overall state of an Entity.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "Custom Modules"
3+
sidebarTitle: Overview
4+
description: "Customize Streams behavior with powerful handlers for subscription lifecycle, event processing, and data transformation."
5+
icon: "circle-info"
6+
---
7+
8+
Cosmo Router provides powerful handlers to hook into the event processing of Cosmo Streams.
9+
These handlers allow you to implement custom logic for subscription lifecycle management, event processing and data transformation.
10+
11+
## Available Hooks
12+
13+
The Cosmo Streams system provides three main hook interfaces that you can implement with [Custom Modules](/router/custom-modules):
14+
15+
- [`SubscriptionOnStartHandler`](/router/cosmo-streams/custom-modules/subscription-on-start): Called when a client subscribes
16+
- [`OnReceiveEventHandler`](/router/cosmo-streams/custom-modules/on-receive-event): Called when events are received from a message broker
17+
- [`OnPublishEventHandler`](/router/cosmo-streams/custom-modules/on-publish-event): Called when events are going to be sent to a message broker

0 commit comments

Comments
 (0)