7 releases

new 0.3.3+0.34.0 Feb 28, 2024
0.3.2+0.34.0 Feb 28, 2024
0.3.1+0.34.0 Jan 5, 2024
0.3.0+0.34.0 Oct 11, 2023
0.2.8-alpha Sep 26, 2022

#9 in Simulation

Download history 4568/week @ 2023-11-07 4605/week @ 2023-11-14 5493/week @ 2023-11-21 5776/week @ 2023-11-28 5109/week @ 2023-12-05 4613/week @ 2023-12-12 4472/week @ 2023-12-19 4333/week @ 2023-12-26 5327/week @ 2024-01-02 5726/week @ 2024-01-09 6563/week @ 2024-01-16 5561/week @ 2024-01-23 7799/week @ 2024-01-30 3265/week @ 2024-02-06 1695/week @ 2024-02-13 3164/week @ 2024-02-20

17,098 downloads per month

Apache-2.0

510KB
10K SLoC

madsim-rdkafka

Crate Docs

The rdkafka simulator on madsim. Mirrors rdkafka v0.34.0 and librdkafka 2.3.0.

Usage

Replace all rdkafka entries in your Cargo.toml:

[dependencies]
rdkafka = { version = "0.3", package = "madsim-rdkafka" }

API Modification

This crate roughly follows the rdkafka API but is NOT exactly the same.

The following functions are modified to be async:

  • FromClientConfig::from_config
  • FromClientConfigAndContext::from_config_and_context
  • ClientConfig::create
  • ClientConfig::create_with_context
  • Client::fetch_metadata
  • Client::fetch_watermarks[^1]
  • Client::fetch_group_list
  • Consumer::seek
  • Consumer::seek_partitions
  • Consumer::commit
  • Consumer::commit_consumer_state
  • Consumer::commit_message
  • Consumer::committed
  • Consumer::committed_offsets
  • Consumer::offsets_for_timestamp
  • Consumer::offsets_for_times
  • Consumer::fetch_metadata
  • Consumer::fetch_watermarks[^1]
  • Consumer::fetch_group_list
  • Producer::flush
  • Producer::init_transactions
  • Producer::send_offsets_to_transaction
  • Producer::commit_transaction
  • Producer::abort_transaction

[^1]: wrapped in tokio::task::spawn_blocking

DNS Resolution

This crate has cherry-picked a commit from Materialize to support rewriting broker addresses.

A new method is added to ClientContext:

  • ClientContext::rewrite_broker_addr

Dependencies

~11–28MB
~399K SLoC