public class KafkaSettingsMapConsumerBuilder extends Object
IKafkaContinuousConsumer
builder. Refer the the kafka KafkaConsumer javadoc.
Here is an example :
kafkaReader = new KafkaConsumerBuilder("localhost:9092", "admin-topic")
.setGroupId("mytenant_apache_processing")
.setTopic("apache")
.setStartOffsetStrategy("earliest")
.setMetricContext(yourMetricContext)
.build();
It is handy to pass in additional kafka standard properties. You can do that using the
For example :
kafkaReader = new KafkaReaderBuilder<byte[], byte[]>()
.setProperty("fetch.max.bytes", 1048576)
...
.build();
Constructor and Description |
---|
KafkaSettingsMapConsumerBuilder() |
Modifier and Type | Method and Description |
---|---|
KafkaAdminConsumer |
build() |
KafkaSettingsMapConsumerBuilder |
setBootstrapServer(String bootstrapServers) |
KafkaSettingsMapConsumerBuilder |
setClientId(String clientId) |
KafkaSettingsMapConsumerBuilder |
setGroupId(String groupId) |
KafkaSettingsMapConsumerBuilder |
setSecurityStores(org.thales.punch.platform.api.pojo.JavaStoreSecurity securityStores) |
KafkaSettingsMapConsumerBuilder |
setTopic(String topic) |
public KafkaSettingsMapConsumerBuilder setBootstrapServer(String bootstrapServers)
bootstrapServers
- the bootstrap server(s) addresspublic KafkaSettingsMapConsumerBuilder setGroupId(String groupId)
groupId
- public KafkaSettingsMapConsumerBuilder setClientId(String clientId)
public KafkaSettingsMapConsumerBuilder setSecurityStores(org.thales.punch.platform.api.pojo.JavaStoreSecurity securityStores)
public KafkaSettingsMapConsumerBuilder setTopic(String topic)
topic
- public KafkaAdminConsumer build()
Copyright © 2014–2023. All rights reserved.