Skip to content

Commit

Permalink
Fix more samples
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyzimarev committed Oct 22, 2024
1 parent 98ae747 commit b2c610f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 27 deletions.
14 changes: 7 additions & 7 deletions docs/versioned_docs/version-0.15/infra/esdb/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ For registering a subscription to `$all` stream, use `AddSubscription<AllStreamS
```csharp
builder.Services.AddSubscription<AllStreamSubscription, AllStreamSubscriptionOptions>(
"BookingsProjections",
builder => builder
b => b
.AddEventHandler<BookingStateProjection>()
.AddEventHandler<MyBookingsProjection>()
);
Expand All @@ -82,7 +82,7 @@ Subscription options for `AllStreamSubscription` are defined in `AllStreamSubscr
```csharp
builder.Services.AddSubscription<AllStreamSubscription, AllStreamSubscriptionOptions>(
"BookingsProjections",
builder => builder
b => b
.UseCheckpointStore<MongoCheckpointStore>()
.AddEventHandler<BookingStateProjection>()
.AddEventHandler<MyBookingsProjection>()
Expand All @@ -99,7 +99,7 @@ Here is an example of using `AllStreamSubscription` with `ConcurrencyLimit` and
var partitionCount = 2;
builder.Services.AddSubscription<AllStreamSubscription, AllStreamSubscriptionOptions>(
"BookingsProjections",
builder => builder
b => b
.Configure(cfg => cfg.ConcurrencyLimit = partitionCount)
.AddEventHandler<BookingStateProjection>()
.AddEventHandler<MyBookingsProjection>()
Expand Down Expand Up @@ -137,9 +137,9 @@ For registering a subscription to a single stream, use `AddSubscription<StreamSu
```csharp
builder.Services.AddSubscription<StreamSubscription, StreamSubscriptionOptions>(
"BookingsStateProjections",
builder => builder
b => b
.Configure(cfg => {
cfg.StreamName = "$ce-Booking";
cfg.StreamName = new StreamName("$ce-Booking");
cfg.ResolveLinkTos = true;
})
.AddEventHandler<BookingStateProjection>()
Expand Down Expand Up @@ -203,7 +203,7 @@ Here's how you set up a persistent subscription to a single stream:
```csharp
builder.Services.AddSubscription<StreamPersistentSubscription, StreamPersistentSubscriptionOptions>(
"PaymentIntegration",
builder => builder
b => b
.Configure(x => x.StreamName = PaymentsIntegrationHandler.Stream)
.AddEventHandler<PaymentsIntegrationHandler>()
);
Expand All @@ -214,7 +214,7 @@ When setting up a persistent subscription to the `$all` stream, you don't need t
```csharp
builder.Services.AddSubscription<AllPersistentSubscription, AllPersistentSubscriptionOptions>(
"CrossAggregateIntegration",
builder => builder.AddEventHandler<CrossAggregateIntegrationHandler>()
b=> b.AddEventHandler<CrossAggregateIntegrationHandler>()
);
```

Expand Down
6 changes: 3 additions & 3 deletions docs/versioned_docs/version-0.15/infra/mssql/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Registering a global log subscription is similar to [EventStoreDB](../esdb/index
```csharp titlle="Program.cs"
builder.Services.AddSubscription<SqlServerAllStreamSubscription, SqlServerAllStreamSubscriptionOptions>(
"BookingsProjections",
builder => builder
b => b
.AddEventHandler<BookingStateProjection>()
.AddEventHandler<MyBookingsProjection>();
);
Expand All @@ -97,7 +97,7 @@ When you register a subscription to a single stream, you need to configure the s
```csharp titlle="Program.cs"
builder.Services.AddSubscription<SqlServerStreamSubscription, SqlServerStreamSubscriptionOptions>(
"StreamSubscription",
builder => builder
b => b
.Configure(x => x.StreamName = "my-stream")
.AddEventHandler<StreamSubscriptionHander>()
);
Expand Down Expand Up @@ -195,7 +195,7 @@ You can then register the projector as a subscription handler:
```csharp titlle="Program.cs"
builder.Services.AddSubscription<SqlServerAllStreamSubscription, SqlServerAllStreamSubscriptionOptions>(
"ImportedBookingsProjections",
builder => builder
b => b
.UseCheckpointStore<SqlServerCheckpointStore>()
.AddEventHandler<ImportingBookingsProjector>();
);
Expand Down
6 changes: 3 additions & 3 deletions docs/versioned_docs/version-0.15/infra/postgres/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Registering a global log subscription is similar to [EventStoreDB](../esdb/index
```csharp titlle="Program.cs"
builder.Services.AddSubscription<PostgresAllStreamSubscription, PostgresAllStreamSubscriptionOptions>(
"BookingsProjections",
builder => builder
b => b
.AddEventHandler<BookingStateProjection>()
.AddEventHandler<MyBookingsProjection>();
);
Expand All @@ -95,7 +95,7 @@ When you register a subscription to a single stream, you need to configure the s
```csharp titlle="Program.cs"
builder.Services.AddSubscription<PostgresStreamSubscription, PostgresStreamSubscriptionOptions>(
"StreamSubscription",
builder => builder
b => b
.Configure(x => x.StreamName = "my-stream")
.AddEventHandler<StreamSubscriptionHander>()
);
Expand Down Expand Up @@ -163,7 +163,7 @@ You can then register the projector as a subscription handler:
```csharp titlle="Program.cs"
builder.Services.AddSubscription<PostgresAllStreamSubscription, PostgresAllStreamSubscriptionOptions>(
"ImportedBookingsProjections",
builder => builder
b => b
.UseCheckpointStore<PostgresCheckpointStore>()
.AddEventHandler<ImportingBookingsProjector>();
);
Expand Down
25 changes: 12 additions & 13 deletions docs/versioned_docs/version-0.15/infra/pubsub/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,18 @@ Eventuous allows you to consume messages from Google Pub/Sub, which are publishe
Normally, you'd add the subscription to the service collection using `AddSubscription` extension method, as any other Eventuous subscription.

```csharp
services
.AddSubscription<GooglePubSubSubscription, PubSubSubscriptionOptions>(
"pubsub-subscription",
builder => builder
.Configure(
x => {
x.ProjectId = "my-gcp-project";
x.TopicId = "my-topic";
x.CreateSubscription = true;
}
)
.AddEventHandler<TestHandler>()
);
builder.Services.AddSubscription<GooglePubSubSubscription, PubSubSubscriptionOptions>(
"pubsub-subscription",
b => b
.Configure(
x => {
x.ProjectId = "my-gcp-project";
x.TopicId = "my-topic";
x.CreateSubscription = true;
}
)
.AddEventHandler<TestHandler>()
);
```

Similarly to the producer, the Eventuous subscription can create a Pub/Sub subscription if it does not exist. Creating a subscription is a one-time operation, so you can set this option to `false` after the subscription is created. Often, you would have a separate process that creates topics and subscriptions, so the `CreateSubscription` option is set to `false` by default.
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-0.15/infra/rabbitmq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ As any other subscription, it can be added to the Di container using `AddSubscri
```csharp
builder.Services.AddSubscription<RabbitMqSubscription, RabbitMqSubscriptionOptions>(
"PaymentsIntegration",
builder => builder
b => b
.Configure(cfg => cfg.Exchange = "payments")
.AddEventHandler<PaymentsHandler>()
);
Expand Down

0 comments on commit b2c610f

Please sign in to comment.