Class 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:
    ReactiveKafkaTracingPropagator
    • 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)  
      • Methods inherited from interface reactor.kafka.receiver.KafkaReceiver

        receiveExactlyOnce
    • 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 record
        V - 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 underlying KafkaReceiver.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 record
        V - 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 underlying KafkaReceiver.create(ConsumerFactory, ReceiverOptions)
        options - Options to provide for underlying KafkaReceiver.create(ConsumerFactory, ReceiverOptions)
      • receive

        public reactor.core.publisher.Flux<reactor.kafka.receiver.ReceiverRecord<K,​V>> receive​(Integer prefetch)
        Specified by:
        receive in interface reactor.kafka.receiver.KafkaReceiver<K,​V>
      • receive

        public reactor.core.publisher.Flux<reactor.kafka.receiver.ReceiverRecord<K,​V>> receive()
        Specified by:
        receive in interface reactor.kafka.receiver.KafkaReceiver<K,​V>
      • receiveAutoAck

        public reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>>> receiveAutoAck​(Integer prefetch)
        Specified by:
        receiveAutoAck in interface reactor.kafka.receiver.KafkaReceiver<K,​V>
      • receiveAutoAck

        public reactor.core.publisher.Flux<reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>>> receiveAutoAck()
        Specified by:
        receiveAutoAck in interface reactor.kafka.receiver.KafkaReceiver<K,​V>
      • receiveAtmostOnce

        public reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>> receiveAtmostOnce​(Integer prefetch)
        Specified by:
        receiveAtmostOnce in interface reactor.kafka.receiver.KafkaReceiver<K,​V>
      • receiveAtmostOnce

        public reactor.core.publisher.Flux<org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>> receiveAtmostOnce()
        Specified by:
        receiveAtmostOnce in interface reactor.kafka.receiver.KafkaReceiver<K,​V>
      • 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)
        Specified by:
        receiveExactlyOnce in interface reactor.kafka.receiver.KafkaReceiver<K,​V>
      • doOnConsumer

        public <T> reactor.core.publisher.Mono<T> doOnConsumer​(Function<org.apache.kafka.clients.consumer.Consumer<K,​V>,​? extends T> function)
        Specified by:
        doOnConsumer in interface reactor.kafka.receiver.KafkaReceiver<K,​V>