Skip to content

Commit

Permalink
docs: update consumer documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-catalao authored and joelfoliveira committed Jun 29, 2023
1 parent a873f3b commit 6f4ee66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions website/docs/guides/consumers/consumers.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ Even when you choose to use the manual offset store option, you will store the o
When the application stops, there is a big chance to have processed messages already stored in OffsetManager but not stored in Kafka. In this scenario, when the application starts again, these messages will be processed again. Your application must be prepared to deal with it.
:::

### Max Poll Intervals

This is the value that Kafka uses to determine the maximum amount of time allowed between calls to the consumers' poll method before the process is considered as failed. By default, this has a value of 300 seconds, but it may be adjusted with the `WithMaxPollInterval` configuration.

If the maximum time is exceeded, the consumer will go offline, but the workers will continue to run in the background, leading to an increasing read lag until the application goes down.

Further information can be found in the official [documentation](https://docs.confluent.io/platform/current/clients/consumer.html#message-handling).

## How it works

The following animation shows a consumer listening to one topic with two [Workers](#workers) having a buffer size of 2 using the **BytesSum** distribution strategy.
Expand Down
4 changes: 4 additions & 0 deletions website/docs/guides/middlewares/batch-consume-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ services.AddKafka(kafka => kafka

To access the batch from the next middleware, use the `GetMessagesBatch` method accessible through the `context` argument.

:::warning
When using the `Batch Consume` middleware, the `IServiceScopeFactory` should be used to create scopes instead of the `IServiceProvider`, as the latter may dispose the scope.
:::

```csharp
using KafkaFlow.BatchConsume;

Expand Down

0 comments on commit 6f4ee66

Please sign in to comment.