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 for
KafkaReceiver that delegates most of the work back to original
consumer, but returns publishers decorated with tracing context per each element.- Author:
- Maciej GromuĊ
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTracingKafkaReceiver(ReactiveKafkaTracingPropagator reactiveKafkaTracingPropagator, reactor.kafka.receiver.KafkaReceiver<K, V> delegate) -
Method Summary
Modifier and TypeMethodDescriptionstatic <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) receive()receiveAtmostOnce(Integer prefetch) reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>> 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) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface reactor.kafka.receiver.KafkaReceiver
receiveExactlyOnce
-
Constructor Details
-
TracingKafkaReceiver
public TracingKafkaReceiver(ReactiveKafkaTracingPropagator reactiveKafkaTracingPropagator, reactor.kafka.receiver.KafkaReceiver<K, V> delegate)
-
-
Method Details
-
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
-
receive
-
receiveAutoAck
-
receiveAutoAck
-
receiveAtmostOnce
-
receiveAtmostOnce
-
receiveExactlyOnce
-
doOnConsumer
-