10 releases

new 0.4.2+0.34.0 May 13, 2024
0.4.1+0.34.0 May 8, 2024
0.3.4+0.34.0 Mar 22, 2024
0.3.3+0.34.0 Feb 28, 2024
0.2.8-alpha Sep 26, 2022

#21 in Simulation

Download history 6040/week @ 2024-01-24 6918/week @ 2024-01-31 2771/week @ 2024-02-07 1790/week @ 2024-02-14 4878/week @ 2024-02-21 5475/week @ 2024-02-28 4468/week @ 2024-03-06 4658/week @ 2024-03-13 4467/week @ 2024-03-20 5156/week @ 2024-03-27 4017/week @ 2024-04-03 3800/week @ 2024-04-10 3631/week @ 2024-04-17 3440/week @ 2024-04-24 1931/week @ 2024-05-01 2393/week @ 2024-05-08

12,480 downloads per month

Apache-2.0

515KB
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.4", 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[^1]
  • Client::fetch_watermarks[^1]
  • Client::fetch_group_list[^1]
  • 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[^1]
  • Consumer::fetch_metadata[^1]
  • Consumer::fetch_watermarks[^1]
  • Consumer::fetch_group_list[^1]
  • Producer::flush
  • Producer::init_transactions
  • Producer::send_offsets_to_transaction
  • Producer::commit_transaction
  • Producer::abort_transaction

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

The associated constant ClientContext::ENABLE_REFRESH_OAUTH_TOKEN is changed to a function in order to make the trait object-safe.

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

~13–29MB
~393K SLoC