public enum SubscriptionType extends Enum<SubscriptionType>
| 枚举常量和说明 |
|---|
Exclusive
There can be only 1 consumer on the same topic with the same subscription name.
|
Failover
Multiple consumer will be able to use the same subscription name but only 1 consumer will receive the messages.
|
Key_Shared
Multiple consumer will be able to use the same subscription and all messages with the same key
will be dispatched to only one consumer
Use ordering_key to overwrite the message key for message ordering.
|
Shared
Multiple consumer will be able to use the same subscription name and the messages will be dispatched according to
a round-robin rotation between the connected consumers.
|
public static final SubscriptionType Exclusive
public static final SubscriptionType Shared
In this mode, the consumption order is not guaranteed.
public static final SubscriptionType Failover
In failover mode, the consumption ordering is guaranteed.
In case of partitioned topics, the ordering is guaranteed on a per-partition basis. The partitions assignments will be split across the available consumers. On each partition, at most one consumer will be active at a given point in time.
public static final SubscriptionType Key_Shared
public static SubscriptionType[] values()
for (SubscriptionType c : SubscriptionType.values()) System.out.println(c);
public static SubscriptionType valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值Copyright © 2017–2019 Apache Software Foundation. All rights reserved.