10 releases
| 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 |
|
| 0.2.8-alpha | Sep 26, 2022 |
#249 in Asynchronous
2,788 downloads per month
515KB
10K
SLoC
madsim-rdkafka
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_configFromClientConfigAndContext::from_config_and_contextClientConfig::createClientConfig::create_with_contextClient::fetch_metadata[^1]Client::fetch_watermarks[^1]Client::fetch_group_list[^1]Consumer::seekConsumer::seek_partitionsConsumer::commitConsumer::commit_consumer_stateConsumer::commit_messageConsumer::committedConsumer::committed_offsetsConsumer::offsets_for_timestampConsumer::offsets_for_times[^1]Consumer::fetch_metadata[^1]Consumer::fetch_watermarks[^1]Consumer::fetch_group_list[^1]Producer::flushProducer::init_transactionsProducer::send_offsets_to_transactionProducer::commit_transactionProducer::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
~14–28MB
~402K SLoC