Records::encode
/Records::decode
no longer has unneeded trait bounds.
Records::encode
/Records::decode
is now reverted back to their original API, insteadencode_with_custom_compression
anddecode_with_custom_compression
is provided for custom compression.ApiKey
variants are renamed to remove theKey
suffix.- Add
iterate_all
andvalid_versions
methods toApiKey
- Implement
PartialEq
andDisplay
forVersionRange
- All "map" types in the protocol that were previously of type
IndexMap<K, V>
are now of typeVec<V>
, the value ofK
is stored as a field withinV
.- This was done to resolve #84 and improve decoding speed.
- If you were previously calling
.get()
on the map, the best way to migrate is to refactor your code to avoid the need to lookup by iterating over the items in the response instead. - Alternatively, you could replace
responses.get(name)
with something likeresponses.iter().find(|x| x.name == name)
to achieve the same result. But note that this access is now O(N) instead of O(1). - Alternatively, you could use an intermediate hashmap before converting to a Vec to retain the O(1) lookup.
- Update protocol to kafka 3.8.0
- The Debug impl for new type wrappers now passes directly to the inner type.
The full list of new type wrappers is BrokerId, GroupId, ProducerId, TopicName and TransactionalId.
For example GroupId was previously
GroupId("some group")
but is now"some group"
. - ApiKey is now non_exhaustive.
- Added
gzip
,zstd
,snappy
andlz4
features to enable the different compression algorithms for records (All enabled by default)
- Add
client
feature to enable encoding of requests and decoding of responses (enabled by default) - Add
broker
feature to enable encoding of responses and decoding of requests (enabled by default) - Add
messages_enums
feature to enableResponseKind
andRequestKind
enums - Add
encode
,decode
andheader_version
methods toResponseKind
andRequestKind
- Replace
derive_builder
with custom impl. - Remove
EncodeError
/DecodeError
aliases - Remove panic from
RecordBatchEncoder::encode
- Use
IntoIterator
instead ofIterator
forRecordBatchEncoder::encode
- Use CRC-32 ISO/HDLC instead of CRC-32 CKSUM.
- Add
Display
and moreFrom<T>
implementations forStrBytes
. - Avoid redundant variant names in RequestKind/ResponseKind.
- Implement
From<T>
for RequestKind and ResponseKind.
- Fix lz4 compression.
- Use
anyhow
for public error types. In general, these errors reflect non-recoverable programmer error and should not occur when interacting with a well-formed Kafka implementation. - Rename
StrBytes::from_str
tofrom_static_str
to avoid overlap with theFromStr
trait. - Improve codegen, including filtering out unstable messages, improving ordering of structs in generated code, and other misc improvements.
- Upgrade message version to upstream
v3.7.0
Kafka.
- Remove the
string
crate. - Update
derive-builder
.
- Expose protocol::buf::gap module.
- Re-export
indexmap
as part of the public api.
- Implement Zstd and Lz4 compression.
- Switch to crc32c crate, providing hardware acceleration for crc operations on supported platforms.
- Formatting fixes.
- Miscellaneous dependency updates.
- Fix issue with
derive_builder
implementation in which default fields were not being used correctly.
- Miscellaneous dependency updates.
- Add
ApiKey::request_header_version
andApiKey::response_header_version
to assist deserializing headers without reference to message type.
Bump uuid
crate version.
- Clarify versioning support for upstream Kafka, tracking the latest Kafka stable release. Improve docs.
Builder::builder
trait for retrieving builder instances from messages without requiring extra builder imports.#[non_exhaustive]
added to all items to ensure forward compatability with protocol upgrades.
- Add utilities for dealing with response error codes.
- Build messages from crate root.
- Upgrade to latest version of Kafka protocol.
- Add derive builder for all messages.
Initial release.