Package org.springframework.kafka.core
Class ABSwitchCluster
- java.lang.Object
-
- org.springframework.kafka.core.ABSwitchCluster
-
- All Implemented Interfaces:
java.util.function.Supplier<java.lang.String>
public class ABSwitchCluster extends java.lang.Object implements java.util.function.Supplier<java.lang.String>ASupplierfor bootstrap servers that can toggle between 2 lists of servers.- Since:
- 2.5
- Author:
- Gary Russell
-
-
Constructor Summary
Constructors Constructor Description ABSwitchCluster(java.lang.String primary, java.lang.String secondary)Construct an instance with primary and secondary bootstrap servers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringget()booleanisPrimary()Get whether or not the primary cluster is active.voidprimary()Use the primary cluster.voidsecondary()Use the secondary cluster.
-
-
-
Method Detail
-
get
public java.lang.String get()
- Specified by:
getin interfacejava.util.function.Supplier<java.lang.String>
-
isPrimary
public boolean isPrimary()
Get whether or not the primary cluster is active.- Returns:
- true for primary, false for secondary.
-
primary
public void primary()
Use the primary cluster.
-
secondary
public void secondary()
Use the secondary cluster.
-
-