Skip to content

Commit

Permalink
Add Trace constraint to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rossabaker committed Jan 2, 2024
1 parent ff53abc commit 7e07bfc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions site/docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,20 @@ We first bring our Kafka producer utils into scope:
import com.banno.kafka.producer._
```

As of kafka4s-6.x, producers are traced with
[Natchez](https://typelevel.org/natchez/), so an implicit `Trace[IO]`
is required. See the [Natchez
backends](https://typelevel.org/natchez/backends/index.html) for more
production solutions.

```scala mdoc
import natchez.Trace.Implicits.noop
```

Now we can create our producer instance:

```scala mdoc

val producer = ProducerApi.Avro.Generic.resource[IO](
BootstrapServers(kafkaBootstrapServers),
SchemaRegistryUrl(schemaRegistryUri),
Expand Down

0 comments on commit 7e07bfc

Please sign in to comment.