public class KafkaTopicMetadataStore
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.integration.metadata.MetadataStore, java.io.Closeable
MetadataStore
that uses a Kafka topic as the underlying support.
For its proper functioning, the Kafka server(s) log.cleaner.enable=true
.Modifier and Type | Field and Description |
---|---|
static org.springframework.integration.kafka.serializer.common.StringDecoder |
DECODER |
static org.springframework.integration.kafka.serializer.common.StringEncoder |
ENCODER |
Constructor and Description |
---|
KafkaTopicMetadataStore(org.springframework.integration.kafka.support.ZookeeperConnect zookeeperConnect,
org.springframework.integration.kafka.core.ConnectionFactory connectionFactory,
java.lang.String topic) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
close() |
java.lang.String |
get(java.lang.String key) |
void |
put(java.lang.String key,
java.lang.String value) |
java.lang.String |
remove(java.lang.String key) |
void |
setCompressionCodec(java.lang.String compressionCodec)
The compression codec for writing to the offset topic
|
void |
setMaxBatchSize(int maxBatchSize)
The maximum batch size for offset writes
|
void |
setMaxQueueBufferingTime(int maxQueueBufferingTime)
For how long will producers buffer data before writing to the topic
|
void |
setMaxSize(int maxSize)
Sets the maximum size of a fetch request, allowing to tune the initialization process.
|
void |
setReplicationFactor(int replicationFactor)
The replication factor of the offset topic
|
void |
setRetentionTime(int retentionTime)
How long are dead records retained in the offset topic
|
void |
setSegmentSize(int segmentSize)
The size of a segment in the offset topic
|
public static final org.springframework.integration.kafka.serializer.common.StringEncoder ENCODER
public static final org.springframework.integration.kafka.serializer.common.StringDecoder DECODER
public KafkaTopicMetadataStore(org.springframework.integration.kafka.support.ZookeeperConnect zookeeperConnect, org.springframework.integration.kafka.core.ConnectionFactory connectionFactory, java.lang.String topic)
public void setMaxSize(int maxSize)
maxSize
- the maximum amount of data to be brought on a fetchpublic void setCompressionCodec(java.lang.String compressionCodec)
compressionCodec
- the compression codecpublic void setMaxQueueBufferingTime(int maxQueueBufferingTime)
maxQueueBufferingTime
- public void setSegmentSize(int segmentSize)
segmentSize
- public void setRetentionTime(int retentionTime)
retentionTime
- public void setReplicationFactor(int replicationFactor)
replicationFactor
- public void setMaxBatchSize(int maxBatchSize)
maxBatchSize
- public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void put(java.lang.String key, java.lang.String value)
put
in interface org.springframework.integration.metadata.MetadataStore
public java.lang.String get(java.lang.String key)
get
in interface org.springframework.integration.metadata.MetadataStore
public java.lang.String remove(java.lang.String key)
remove
in interface org.springframework.integration.metadata.MetadataStore
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException