Skip to content

Commit

Permalink
Updated docs (#244)
Browse files Browse the repository at this point in the history
* Updated getting-started

* Updated name of packages

* Updated docs structure

* Updated docs
  • Loading branch information
adimiko authored Jun 4, 2024
1 parent 79d7cd6 commit 56efe4f
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 149 deletions.
3 changes: 1 addition & 2 deletions documentation/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Example shows in-memory implementation.
## Configuration
### Install packages
```csharp
dotnet add package TransactionalBox.Outbox
dotnet add package TransactionalBox.Inbox
dotnet add package TransactionalBox
```
### Register
```csharp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
sidebar_position: 1
sidebar_position: 4
---

# General
# Inbox

The inbox is responsible for getting messages from the transport and adding them to the storage, and then processes these messages.

Expand Down
4 changes: 0 additions & 4 deletions documentation/docs/inbox/_category_.json

This file was deleted.

4 changes: 0 additions & 4 deletions documentation/docs/inbox/storage/_category_.json

This file was deleted.

54 changes: 0 additions & 54 deletions documentation/docs/inbox/storage/entity-framework-core.md

This file was deleted.

20 changes: 0 additions & 20 deletions documentation/docs/inbox/storage/in-memory.md

This file was deleted.

4 changes: 0 additions & 4 deletions documentation/docs/inbox/transport/_category_.json

This file was deleted.

23 changes: 0 additions & 23 deletions documentation/docs/inbox/transport/kafka.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
sidebar_position: 1
sidebar_position: 3
---

# General
# Outbox

The outbox is responsible for adding messages to the storage and then adding at least once to the transport.

Expand Down
4 changes: 0 additions & 4 deletions documentation/docs/outbox/_category_.json

This file was deleted.

23 changes: 0 additions & 23 deletions documentation/docs/outbox/transport/kafka.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Storage",
"position": 2
"position": 5
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ builder.Services.AddDbContextPool<SampleDbContext>(x => x.Use...(connectionStrin
```
:::



## Configuration
### Install package
## Install package
```csharp
dotnet add package TransactionalBox.Outbox.EntityFrameworkCore
dotnet add package TransactionalBox.EntityFrameworkCore
```

## Outbox
### Register entity framework as outbox storage
```csharp
builder.Services.AddTransactionalBox(x =>
Expand All @@ -51,4 +49,27 @@ public class SampleDbContext : DbContext
}
...
}
```

## Inbox
### Register entity framework as inbox storage
```csharp
builder.Services.AddTransactionalBox(x =>
{
x.AddInbox(storage => storage.UseEntityFramework<SampleDbContext>());
});

```

### Add Inbox to ModelBuilder
```csharp
public class SampleDbContext : DbContext
{
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.AddInbox();
}
...
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,22 @@ InMemory is registered as default storage.
Intended only for testing and learning.
:::

## Outbox
### Register
```csharp
builder.Services.AddTransactionalBox(x =>
{
x.AddOutbox();
});

```

## Inbox
### Register
```csharp
builder.Services.AddTransactionalBox(x =>
{
x.AddInbox();
});

```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Transport",
"position": 2
"position": 6
}
35 changes: 35 additions & 0 deletions documentation/docs/transport/kafka.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
sidebar_position: 1
---

# Apache Kafka

## Install package
```csharp
dotnet add package TransactionalBox.Kafka
```
## Outbox
### Register
```csharp
builder.Services.AddTransactionalBox(x =>
{
x.AddOutbox(
storage => ...,
transport => transport.UseKafka(settings => settings.BootstrapServers = bootstrapServers)
);
});

```

## Inbox
### Register
```csharp
builder.Services.AddTransactionalBox(x =>
{
x.AddInbox(
storage => ...,
transport => transport.UseKafka(settings => settings.BootstrapServers = bootstrapServers)
);
});

```

0 comments on commit 56efe4f

Please sign in to comment.