pub trait ConsumerGroupMetadata:
Send
+ Sync
+ Debug
+ 'static {
// Required methods
fn group_id(&self) -> &str;
fn generation_id(&self) -> i32;
fn member_id(&self) -> &str;
fn group_instance_id(&self) -> Option<&str>;
}Expand description
The consumer group information: group id, generation id, member id and group instance id.
Corresponds to Java’s
org.apache.kafka.clients.consumer.ConsumerGroupMetadata.
Java has deprecated both public constructors since 4.2
(@Deprecated(since = "4.2", forRemoval = true)): “please use
KafkaConsumer#groupMetadata() instead. This class will be an interface in
Kafka 5.0.” The Rust client translates the class directly in its 5.0 shape,
a trait, so the deprecated constructors are never public. The only way to
obtain a value is Consumer::group_metadata,
which returns the implementation owned by the consumer. The trait is
dyn-compatible, so send_offsets_to_transaction accepts the metadata of any
consumer implementation, including a future classic-protocol one.
Display on dyn ConsumerGroupMetadata renders Java’s
toString().
Required Methods§
Sourcefn generation_id(&self) -> i32
fn generation_id(&self) -> i32
The current generation ID, or -1 (UNKNOWN_GENERATION_ID) if unknown.
Sourcefn group_instance_id(&self) -> Option<&str>
fn group_instance_id(&self) -> Option<&str>
The group instance ID, if the consumer is a static member.