Skip to content

Commit

Permalink
Explain LoadAndRun
Browse files Browse the repository at this point in the history
  • Loading branch information
bcarter97 committed Oct 23, 2023
1 parent 0ed5810 commit 6c9a572
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

# fs2-kafka-topic-loader

Reads the contents of provided Kafka topics determined by the `LoadTopicStrategy`.

- `LoadAll` - reads the topics in their entirety
- `LoadCommitted` - reads up to the configured consumer-group's last committed Offset
Reads the contents of provided Kafka topics.

This library is aimed for usage in applications that want a deterministic stream of Kafka messages that completes once
the last message (determined above) has been read. This is useful if an application shouldn't respond to new events
Expand All @@ -16,6 +13,21 @@ of a topic needs to be reloaded on an application restart.

## Usage

### `Load`

Determined by the `LoadTopicStrategy`, this stream completes once all messages have been read.

Load strategies:

- `LoadAll` - reads the topics in their entirety
- `LoadCommitted` - reads up to the configured consumer-group's last committed Offset

### `LoadAndRun`

Read up to the latest offset, fire a callback and continue streaming messages.

## Example

Add the following to your `build.sbt`:

```scala
Expand Down Expand Up @@ -77,7 +89,6 @@ object Main extends IOApp.Simple {
}
```


## Configuration

Configuration from the Topic Loader is done via the `ConsumerSettings`. The group id of the Topic Loader should match
Expand Down

0 comments on commit 6c9a572

Please sign in to comment.