Class TracingKafkaReceiver<K,V>
- java.lang.Object
-
- org.springframework.cloud.sleuth.instrument.kafka.TracingKafkaReceiver<K,V>
-
- All Implemented Interfaces:
reactor.kafka.receiver.KafkaReceiver<K,V>
public class TracingKafkaReceiver<K,V> extends Object implements reactor.kafka.receiver.KafkaReceiver<K,V>
Decorator forKafkaReceiverthat delegates most of the work back to original consumer, but returns publishers decorated with tracing context per each element.- Author:
- Maciej GromuĊ
- See Also:
ReactiveKafkaTracingPropagator
-
-
Constructor Summary
Constructors Constructor Description TracingKafkaReceiver(ReactiveKafkaTracingPropagator reactiveKafkaTracingPropagator, reactor.kafka.receiver.KafkaReceiver<K,V> delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
reactor.kafka.receiver.KafkaReceiver<K,V>create(ReactiveKafkaTracingPropagator reactiveKafkaTracingPropagator, reactor.kafka.receiver.internals.ConsumerFactory factory, reactor.kafka.receiver.ReceiverOptions<K,V> options)Creates KafkaReceiver that will de decorated by tracing propagator to provide kafka consumer publishing elements containing tracing context in their reactor context.static <K,V>
reactor.kafka.receiver.KafkaReceiver<K,V>create(ReactiveKafkaTracingPropagator reactiveKafkaTracingPropagator, reactor.kafka.receiver.ReceiverOptions<K,V> options)Creates KafkaReceiver that will de decorated by tracing propagator to provide kafka consumer publishing elements containing tracing context in their reactor context.<T> reactor.core.publisher.Mono<T>doOnConsumer(Function<org.apache.kafka.clients.consumer.Consumer<K,V>,? extends T> function)reactor.core.publisher.Flux<reactor.kafka.receiver.ReceiverRecord<K,V>>receive()reactor.core.publisher.Flux<reactor.kafka.receiver.ReceiverRecord<K,V>>receive(Integer prefetch)reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>receiveAtmostOnce()reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>receiveAtmostOnce(Integer prefetch)reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>>receiveAutoAck()reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>>receiveAutoAck(Integer prefetch)reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>>receiveExactlyOnce(reactor.kafka.sender.TransactionManager transactionManager, Integer prefetch)
-
-
-
Constructor Detail
-
TracingKafkaReceiver
public TracingKafkaReceiver(ReactiveKafkaTracingPropagator reactiveKafkaTracingPropagator, reactor.kafka.receiver.KafkaReceiver<K,V> delegate)
-
-
Method Detail
-
create
public static <K,V> reactor.kafka.receiver.KafkaReceiver<K,V> create(ReactiveKafkaTracingPropagator reactiveKafkaTracingPropagator, reactor.kafka.receiver.ReceiverOptions<K,V> options)
Creates KafkaReceiver that will de decorated by tracing propagator to provide kafka consumer publishing elements containing tracing context in their reactor context.- Type Parameters:
K- Key of the recordV- Value of the record- Parameters:
reactiveKafkaTracingPropagator- Instance of trace propagation decorator. Should be available in spring application context as a bean.options- Options to pass for underlyingKafkaReceiver.create(ReceiverOptions)
-
create
public static <K,V> reactor.kafka.receiver.KafkaReceiver<K,V> create(ReactiveKafkaTracingPropagator reactiveKafkaTracingPropagator, reactor.kafka.receiver.internals.ConsumerFactory factory, reactor.kafka.receiver.ReceiverOptions<K,V> options)
Creates KafkaReceiver that will de decorated by tracing propagator to provide kafka consumer publishing elements containing tracing context in their reactor context.- Type Parameters:
K- Key of the recordV- Value of the record- Parameters:
reactiveKafkaTracingPropagator- Instance of trace propagation decorator. Should be available in spring application context as a bean.factory- Custom factory to provide for underlyingKafkaReceiver.create(ConsumerFactory, ReceiverOptions)options- Options to provide for underlyingKafkaReceiver.create(ConsumerFactory, ReceiverOptions)
-
receive
public reactor.core.publisher.Flux<reactor.kafka.receiver.ReceiverRecord<K,V>> receive(Integer prefetch)
-
receiveAutoAck
public reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>> receiveAutoAck(Integer prefetch)
-
receiveAutoAck
public reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>> receiveAutoAck()
-
receiveAtmostOnce
public reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> receiveAtmostOnce(Integer prefetch)
-
receiveAtmostOnce
public reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> receiveAtmostOnce()
-
receiveExactlyOnce
public reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>> receiveExactlyOnce(reactor.kafka.sender.TransactionManager transactionManager, Integer prefetch)
-
-