# Quickstart

- Start Kafka 4.0+ on `localhost:9092`.
- Add `kafkit-client` to your Rust project.
- Use `KafkaClient` for the shortest path.

```rust
use kafkit_client::{AutoOffsetReset, KafkaClient, KafkaMessage};

# async fn example() -> kafkit_client::Result<()> {
let orders = KafkaClient::new("localhost:9092").topic("orders");

let producer = orders.producer().connect().await?;
producer.send_message(KafkaMessage::new("created")).await?;

let consumer = orders
    .consumer("orders-reader")
    .with_auto_offset_reset(AutoOffsetReset::Earliest)
    .connect()
    .await?;
let records = consumer.poll().await?;
consumer.commit(&records).await?;

consumer.shutdown().await?;
producer.shutdown().await?;
# Ok(())
# }
```

