Class ReactiveKafkaProducerTemplate<K,V>
java.lang.Object
org.springframework.kafka.core.reactive.ReactiveKafkaProducerTemplate<K,V>
- Type Parameters:
K
- the key type.V
- the value type.
- All Implemented Interfaces:
AutoCloseable
,DisposableBean
public class ReactiveKafkaProducerTemplate<K,V>
extends Object
implements AutoCloseable, DisposableBean
Reactive kafka producer operations implementation.
- Since:
- 2.3.0
- Author:
- Mark Norkin, Adrian Chlebosz
-
Constructor Summary
ConstructorsConstructorDescriptionReactiveKafkaProducerTemplate
(reactor.kafka.sender.KafkaSender<K, V> sender) ReactiveKafkaProducerTemplate
(reactor.kafka.sender.KafkaSender<K, V> sender, RecordMessageConverter messageConverter) ReactiveKafkaProducerTemplate
(reactor.kafka.sender.SenderOptions<K, V> senderOptions) ReactiveKafkaProducerTemplate
(reactor.kafka.sender.SenderOptions<K, V> senderOptions, RecordMessageConverter messageConverter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
destroy()
<T> reactor.core.publisher.Mono<T>
doOnProducer
(Function<org.apache.kafka.clients.producer.Producer<K, V>, ? extends T> action) reactor.core.publisher.Flux<reactor.util.function.Tuple2<org.apache.kafka.common.MetricName,
? extends org.apache.kafka.common.Metric>> reactor.core.publisher.Flux<org.apache.kafka.common.PartitionInfo>
partitionsFromProducerFor
(String topic) reactor.core.publisher.Mono<reactor.kafka.sender.SenderResult<Void>>
reactor.core.publisher.Mono<reactor.kafka.sender.SenderResult<Void>>
reactor.core.publisher.Mono<reactor.kafka.sender.SenderResult<Void>>
reactor.core.publisher.Mono<reactor.kafka.sender.SenderResult<Void>>
reactor.core.publisher.Mono<reactor.kafka.sender.SenderResult<Void>>
reactor.core.publisher.Mono<reactor.kafka.sender.SenderResult<Void>>
<T> reactor.core.publisher.Flux<reactor.kafka.sender.SenderResult<T>>
<T> reactor.core.publisher.Mono<reactor.kafka.sender.SenderResult<T>>
<T> reactor.core.publisher.Flux<reactor.kafka.sender.SenderResult<T>>
sendTransactionally
(org.reactivestreams.Publisher<? extends reactor.kafka.sender.SenderRecord<K, V, T>> records) <T> reactor.core.publisher.Mono<reactor.kafka.sender.SenderResult<T>>
sendTransactionally
(reactor.kafka.sender.SenderRecord<K, V, T> record) reactor.kafka.sender.TransactionManager
-
Constructor Details
-
ReactiveKafkaProducerTemplate
-
ReactiveKafkaProducerTemplate
public ReactiveKafkaProducerTemplate(reactor.kafka.sender.SenderOptions<K, V> senderOptions, RecordMessageConverter messageConverter) -
ReactiveKafkaProducerTemplate
-
ReactiveKafkaProducerTemplate
public ReactiveKafkaProducerTemplate(reactor.kafka.sender.KafkaSender<K, V> sender, RecordMessageConverter messageConverter)
-
-
Method Details
-
sendTransactionally
-
sendTransactionally
-
send
-
send
-
send
-
send
-
send
-
send
-
send
-
send
-
partitionsFromProducerFor
public reactor.core.publisher.Flux<org.apache.kafka.common.PartitionInfo> partitionsFromProducerFor(String topic) -
metricsFromProducer
public reactor.core.publisher.Flux<reactor.util.function.Tuple2<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric>> metricsFromProducer() -
doOnProducer
-
transactionManager
public reactor.kafka.sender.TransactionManager transactionManager() -
destroy
public void destroy()- Specified by:
destroy
in interfaceDisposableBean
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-