Skip to content

Commit

Permalink
docs: update quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilherme Ferreira committed Dec 6, 2023
1 parent c0f4ca1 commit 4f1b5c7
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions website/docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ The consumer will use a Simple Retry strategy to retry in case of a given except

By the end of the article, you will know how to use KafkaFlow Retry Extensions to make your Consumers resilient.


## Prerequisites

- [.NET 6.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
- [.NET 6.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)

## Overview

Expand All @@ -30,7 +29,7 @@ To connect them, you will be running an Apache Kafka cluster using Docker.

### 1. Create a folder for your applications

Create a new folder with the name _KafkaFlowRetryuickstart_.
Create a new folder with the name _KafkaFlowRetryQuickstart_.

### 2. Setup Apache Kafka

Expand All @@ -47,6 +46,7 @@ docker-compose up -d
### 4. Create Producer Project

Run the following command to create a Console Project named _Producer_.

```bash
dotnet new console --name Producer
```
Expand All @@ -59,8 +59,6 @@ Inside the _Producer_ project directory, run the following commands to install t
dotnet add package KafkaFlow
dotnet add package KafkaFlow.Microsoft.DependencyInjection
dotnet add package KafkaFlow.LogHandler.Console
dotnet add package KafkaFlow.TypedHandler
dotnet add package KafkaFlow.Serializer
dotnet add package KafkaFlow.Serializer.JsonCore
dotnet add package Microsoft.Extensions.DependencyInjection
```
Expand All @@ -85,8 +83,8 @@ Replace the content of the _Program.cs_ with the following example:
```csharp
using Microsoft.Extensions.DependencyInjection;
using KafkaFlow.Producers;
using KafkaFlow.Serializer;
using KafkaFlow;
using KafkaFlow.Serializer;
using Producer;

var services = new ServiceCollection();
Expand Down Expand Up @@ -128,10 +126,10 @@ Console.WriteLine("Message sent!");

```


### 8. Create Consumer Project

Run the following command to create a Console Project named _Consumer_.

```bash
dotnet new console --name Consumer
```
Expand All @@ -154,8 +152,6 @@ Inside the _Consumer_ project directory, run the following commands to install t
dotnet add package KafkaFlow
dotnet add package KafkaFlow.Microsoft.DependencyInjection
dotnet add package KafkaFlow.LogHandler.Console
dotnet add package KafkaFlow.TypedHandler
dotnet add package KafkaFlow.Serializer
dotnet add package KafkaFlow.Serializer.JsonCore
dotnet add package Microsoft.Extensions.DependencyInjection
```
Expand All @@ -174,7 +170,6 @@ Create a new class file named _HelloMessageHandler.cs_ and add the following exa

```csharp
using KafkaFlow;
using KafkaFlow.TypedHandler;
using Producer;

namespace Consumer;
Expand Down Expand Up @@ -215,10 +210,9 @@ Replace the content of the _Program.cs_ with the following example.

```csharp
using KafkaFlow;
using KafkaFlow.Serializer;
using Microsoft.Extensions.DependencyInjection;
using KafkaFlow.TypedHandler;
using KafkaFlow.Retry;
using KafkaFlow.Serializer;
using Consumer;

const string topicName = "sample-topic";
Expand All @@ -245,7 +239,7 @@ services.AddKafka(kafka => kafka
TimeSpan.FromMilliseconds(Math.Pow(2, retryCount) * 1000)
)
)
.AddSerializer<JsonCoreSerializer>()
.AddDeserializer<JsonCoreDeserializer>()
.AddTypedHandlers(h => h.AddHandler<HelloMessageHandler>())
)
)
Expand All @@ -268,7 +262,7 @@ await bus.StopAsync();
From the `KafkaFlowRetryQuickstart` directory:

1. Run the Consumer:

```bash
dotnet run --project Consumer/Consumer.csproj
```
Expand Down

0 comments on commit 4f1b5c7

Please sign in to comment.