rust-rdkafka v0.24.0 Release Notes

Release Date: 2020-07-08 // almost 4 years ago
    • ๐Ÿ’ฅ Breaking change. Introduce a dependency on Tokio for the StreamConsumer in its default configuration. The new implementation is more efficient and does not require a background thread and an extra futures executor.

    • Introduce the StreamConsumer::start_with_runtime and FutureProducer::send_with_runtime methods. These methods are identical to their respective non-_with_runtime counterparts, except that they take an additional AsyncRuntime generic parameter that permits using an asynchronous runtime besides Tokio.

    For an example of using rdkafka with the [smol] runtime, see the new smol runtime example.

    • ๐Ÿ’ฅ Breaking change. Remove the StreamConsumer::stop method. To stop a StreamConsumer after calling start, simply drop the resulting MessageStream.

    • ๐Ÿ’ฅ Breaking change. Overhaul the FutureProducer::send method. The old implementation incorrectly blocked asynchronous tasks with std::thread::sleep and the block_ms parameter did not behave as documented.

    The new implementation:

    * changes the `block_ms: i64` parameter to
      `queue_timeout: impl Into<Timeout>`, to better match how timeouts are
      handled elsewhere in the rust-rdkafka API,
    
    * depends on Tokio, in order to retry enqueuing after a time interval
      without using `std::thread::sleep`,
    
    * returns an opaque future that borrows its input, rather than a
      `DeliveryFuture` with no internal references,
    
    * simplifies the output type of the returned future from
      `Result<OwnedDeliveryResult, oneshot::Canceled>` to `OwnedDeliveryResult`.
    

    Thanks to @FSMaxB-dooshop for discovering the issue and contributing the initial fix.

    • ๐Ÿ’ฅ Breaking change. Remove the util::duration_to_millis function. This functionality has been available in the standard library as std::time::Duration::as_millis for over a year.

    • Introduce the BaseConsumer::split_partition_queue method to allow reading messages from partitions independently of one another.

    • ๐Ÿ‘ฏ Implement Clone, Copy, and Debug for CommitMode.

    • Decouple versioning of rdkafka-sys from rdkafka. rdkafka-sys now has its own [changelog](rdkafka-sys/changelog.md) and will follow SemVer conventions. (#211)

    ๐Ÿ“„ [smol]: docs.rs/smol