K
- the key type.V
- the value type.public interface KafkaOperations<K,V>
ListenableFuture
s.Modifier and Type | Interface and Description |
---|---|
static interface |
KafkaOperations.ProducerCallback<K,V,T>
A callback for executing arbitrary operations on the
Producer . |
Modifier and Type | Method and Description |
---|---|
<T> T |
execute(KafkaOperations.ProducerCallback<K,V,T> callback)
Execute some arbitrary operation(s) on the producer and return the result.
|
void |
flush()
Flush the producer.
|
java.util.Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> |
metrics()
See
Producer.metrics() . |
java.util.List<org.apache.kafka.common.PartitionInfo> |
partitionsFor(java.lang.String topic)
See
Producer.partitionsFor(String) . |
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> |
send(org.springframework.messaging.Message<?> message)
Send a message with routing information in message headers.
|
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> |
send(java.lang.String topic,
int partition,
K key,
V data)
Send the data to the provided topic with the provided key and partition.
|
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> |
send(java.lang.String topic,
int partition,
V data)
Send the data to the provided topic with the provided partition and no key.
|
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> |
send(java.lang.String topic,
K key,
V data)
Send the data to the provided topic with the provided key and no partition.
|
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> |
send(java.lang.String topic,
V data)
Send the data to the provided topic with no key or partition.
|
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> |
sendDefault(int partition,
K key,
V data)
Send the data to the default topic with the provided key and partition.
|
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> |
sendDefault(K key,
V data)
Send the data to the default topic with the provided key and no partition.
|
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> |
sendDefault(V data)
Send the data to the default topic with no key or partition.
|
org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> sendDefault(V data)
data
- The data.SendResult
.org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> sendDefault(K key, V data)
key
- the key.data
- The data.SendResult
.org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> sendDefault(int partition, K key, V data)
partition
- the partition.key
- the key.data
- the data.SendResult
.org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> send(java.lang.String topic, V data)
topic
- the topic.data
- The data.SendResult
.org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> send(java.lang.String topic, K key, V data)
topic
- the topic.key
- the key.data
- The data.SendResult
.org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> send(java.lang.String topic, int partition, V data)
topic
- the topic.partition
- the partition.data
- The data.SendResult
.org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> send(java.lang.String topic, int partition, K key, V data)
topic
- the topic.partition
- the partition.key
- the key.data
- the data.SendResult
.org.springframework.util.concurrent.ListenableFuture<SendResult<K,V>> send(org.springframework.messaging.Message<?> message)
message
- the message to send.SendResult
.KafkaHeaders.TOPIC
,
KafkaHeaders.PARTITION_ID
,
KafkaHeaders.MESSAGE_KEY
java.util.List<org.apache.kafka.common.PartitionInfo> partitionsFor(java.lang.String topic)
Producer.partitionsFor(String)
.topic
- the topic.java.util.Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> metrics()
Producer.metrics()
.<T> T execute(KafkaOperations.ProducerCallback<K,V,T> callback)
T
- the result type.callback
- the callback.void flush()