public class KafkaSink extends AbstractModuleFixture<KafkaSink>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_BROKER_LIST |
static java.lang.String |
DEFAULT_TOPIC |
label
Constructor and Description |
---|
KafkaSink(java.lang.String zkConnect)
Initializes a Sink fixture;
|
Modifier and Type | Method and Description |
---|---|
KafkaSink |
brokerList(java.lang.String zkConnect)
Set the brokerList for the sink
|
KafkaSink |
ensureReady()
Ensure that the kafka broker socket is available by polling it for up to 2 seconds
|
protected java.lang.String |
toDSL()
Returns a representation of the module suitable for inclusion in a stream definition, e.g.
file --dir=xxxx --name=yyyy |
KafkaSink |
topic(java.lang.String topic)
Set the topic that the sink will publish to
|
static KafkaSink |
withDefaults()
Returns an instance of the KafkaSink using defaults.
|
label, toString
public static final java.lang.String DEFAULT_BROKER_LIST
public static final java.lang.String DEFAULT_TOPIC
public KafkaSink(java.lang.String zkConnect)
zkConnect
- The list of brokers to connect.public static KafkaSink withDefaults()
protected java.lang.String toDSL()
AbstractModuleFixture
file --dir=xxxx --name=yyyy
toDSL
in class AbstractModuleFixture<KafkaSink>
public KafkaSink brokerList(java.lang.String zkConnect)
zkConnect
- A list of brokers that the sink can connectpublic KafkaSink topic(java.lang.String topic)
topic
- the topic the sink will publishpublic KafkaSink ensureReady()
java.lang.IllegalStateException
- if can not connect in 2 seconds.