pub enum MessageRoutingMode {
KeyHashOrRoundRobin,
RoundRobin,
SinglePartition(u32),
}Expand description
How a PartitionedProducer picks the partition for an outgoing message.
Variants§
KeyHashOrRoundRobin
Hash the message’s partition key via Java’s String.hashCode() (the
HashingScheme.JavaStringHash default), then % partitions. Falls back
to round-robin when no key is set or the key is empty. Wire-compatible
with Java’s default routing: the same key on a Rust producer and a
Java producer lands on the same partition.
RoundRobin
Always round-robin, ignoring any partition key.
SinglePartition(u32)
Always route to a single partition (single_partition_index). Useful for ordered
streams that don’t need parallelism.
Trait Implementations§
Source§impl Clone for MessageRoutingMode
impl Clone for MessageRoutingMode
Source§fn clone(&self) -> MessageRoutingMode
fn clone(&self) -> MessageRoutingMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MessageRoutingMode
Source§impl Debug for MessageRoutingMode
impl Debug for MessageRoutingMode
Source§impl Default for MessageRoutingMode
impl Default for MessageRoutingMode
Source§fn default() -> MessageRoutingMode
fn default() -> MessageRoutingMode
Returns the “default value” for a type. Read more
impl Eq for MessageRoutingMode
Source§impl PartialEq for MessageRoutingMode
impl PartialEq for MessageRoutingMode
impl StructuralPartialEq for MessageRoutingMode
Auto Trait Implementations§
impl Freeze for MessageRoutingMode
impl RefUnwindSafe for MessageRoutingMode
impl Send for MessageRoutingMode
impl Sync for MessageRoutingMode
impl Unpin for MessageRoutingMode
impl UnsafeUnpin for MessageRoutingMode
impl UnwindSafe for MessageRoutingMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more