public enum MessageRoutingMode extends Enum<MessageRoutingMode>
This logic is applied when the application is not setting a key MessageBuilder#setKey(String)
on a particular message.
枚举常量和说明 |
---|
CustomPartition
Use custom message router implementation that will be called to determine the partition
for a particular message.
|
RoundRobinPartition
If no key is provided, the producer will publish messages across all partitions in round-robin fashion
to achieve maximum throughput.
|
SinglePartition
If no key is provided, The partitioned producer will randomly pick one single partition
and publish all the messages into that partition.
|
public static final MessageRoutingMode SinglePartition
public static final MessageRoutingMode RoundRobinPartition
While if a key is specified on the message, the partitioned producer will hash the key and assign message to a particular partition.
public static final MessageRoutingMode CustomPartition
public static MessageRoutingMode[] values()
for (MessageRoutingMode c : MessageRoutingMode.values()) System.out.println(c);
public static MessageRoutingMode valueOf(String name)
name
- 要返回的枚举常量的名称。IllegalArgumentException
- 如果该枚举类型没有带有指定名称的常量NullPointerException
- 如果参数为空值Copyright © 2017–2020 Apache Software Foundation. All rights reserved.