rust-rdkafka v0.29.0 Release Notes
Release Date: 2022-10-29 // over 2 years ago-
- π₯ Breaking change. Pass through errors from librdkafka in
BaseProducer::flush
,StreamProducer::flush
, andFutureProducer::flush
.
Thanks, @cjubb39.
π₯ Breaking change. Only provide
NaiveRuntime
if thenaive-runtime
feature is enabled. This elides a dependency onfutures-executor
when thenaive-runtime
feature is disabled.π₯ Breaking change. Remove the deprecated
StreamConsumer::start
method. Use the more clearly namedStreamConsumer::stream
method instead.π₯ Breaking change. Rework the
Headers
trait to distinguish between headers with null values and headers with empty values. TheHeaders::get
andHeaders::get_as
methods now return aHeader
struct with the following definition:
pub struct Header<'a, V> { pub key: &'a str, pub value: Option<V>, }
Previously, these methods operated in terms of keyβvalue pair
(&str, &[u8])
.These methods now panic if presented with an out-of-bounds index. This simplifies their usage in the common case where the index is known to be valid. Use the new
Headers::try_get
andHeaders::try_get_as
methods if you need the old behavior of returningNone
if the index is invalid.π Rename the
OwnedHeader::add
method toOwnedHeader::insert
, for parity with the equivalent method for the map types instd::collection
and to avoid confusion with theadd
method of thestd::ops::Add
trait. The method now takes theHeader
type mentioned above as an argument, rather than the key and value as separate arguments.β Add the
Headers::iter
method to iterate over all message headers in order.Add the
PartitionQueue::set_nonempty_callback
method to register a callback for a specific partition queue that will run when that queue becomes nonempty. This is a more flexible replacement for theConsumerContext::message_queue_nonempty_callback
method that was removed in the last release.In
BaseConsumer::rebalance_protocol
andStreamConsumer::rebalance_protocol
, handle null return values from the underlying librdkakfa API (#417). This avoids an occasional segfault in the rebalance callback.
Thanks, @bruceg.
β Add a
tracing
feature which, when enabled, emits log messages using thetracing
crate rather than thelog
crate.β Add support for the
OAUTHBEARER
SASL authentication mechanism via the newClientContext::ENABLE_REFRESH_OAUTH_TOKEN
constant and the newClientContext::generate_oauth_token
method.
Thanks, @jsurany-bloomberg.
- π₯ Breaking change. Pass through errors from librdkafka in
Previous changes from v0.28.0
-
- Add the
StreamConsumer::split_partition_queue
method to mirrorBaseConsumer::split_partition_queue
(#411).
Thanks to @davidblewett, @duarten, and @nemosupremo for contributing to the implementation.
π₯ Breaking change. Remove the
StreamConsumerContext
type and theConsumerContext::message_queue_nonempty_callback
method. These were essentially implementation details ofStreamConsumer
that had leaked into the public API. The vast majority of users should be unaffected.π₯ Breaking change. Remove the type parameters from the
MessageStream
type.π₯ Breaking change. Add the received
TopicPartitionList
to theRebalance::Revoke
variant, which is useful when using incremental cooperative rebalancing (#398).Avoid crashing if librdkafka invokes the commit callback with a null topic partition list (#406).
Thanks, @thijsc.
β Add the new statistics fields in librdkafka v1.7.0 to the various statistics types. The new fields are:
Partition::consumer_lag_stored
Broker::txidle
Broker::rxidle
Statistics::age
π₯ Breaking change. Change the type of the following statistics fields from
i64
tou64
to reflect the signedness of the upstream types:Statistics::msg_cnt
Statistics::msg_size
Statistics::msg_max
Statistics::msg_size_max
Broker::tx
Broker::txbytes
Broker::txretries
Broker::req_timeouts
Broker::rx
Broker::rxbytes
Broker::rxerrs
Broker::rxcorriderrs
Broker::rxpartial
Broker::zbuf_grow
Broker::buf_grow
Broker::wakeups
Broker::msgq_bytes
Broker::xmit_msgq_bytes
Broker::fetchq_size
Partition::txmsgs
Partition::txbytes
Partition::rxmsgs
Partition::rxbytes
Partition::msgs
Partition::rx_ver_drops
Partition::acked_msgid
β Add the
ClientContext::stats_raw
method to consume the JSON-encoded statistics from librdkafka. The default implementation callsClientContext::stats
with the decoded statistics.β Add the
Default
trait to the statistics types:Statistics
,Broker
,Window
,TopicPartition
,Topic
,Partition
,ConsumerGroup
, andExactlyOnceSemantics
(#410).
Thanks, @scanterog.
- β Add the
Debug
trait toDefaultClientContext
andDefaultConsumerContext
(#401).
Thanks, @DXist.
- Add the