Skip navigation links
Reactor Kafka

Reactor Kafka 1.3.23

This document is the API specification for the Reactor Kafka library.

See: Description

Packages 
Package Description
reactor.kafka.receiver
Reactor Kafka Receiver API
reactor.kafka.receiver.observation
Provides classes to support of Micrometer Observation API for Reactor Kafka Receiver.
reactor.kafka.sender
Reactor Kafka Sender API
reactor.kafka.sender.observation
Provides classes to support of Micrometer Observation API for Reactor Kafka Sender.
This document is the API specification for the Reactor Kafka library.

Reactor Kafka is a reactive API for Apache Kafka based on Project Reactor. Reactor Kafka API enables messages to be published to Kafka topics and consumed from Kafka topics using functional APIs with non-blocking back-pressure and very low overheads. This enables applications using Reactor to use Kafka as a message bus or streaming platform and integrate with other systems to provide an end-to-end reactive pipeline.

KafkaSender

    sender.send(Flux.range(1, 10).map(i -> SenderRecord.create(new ProducerRecord<>(topic, i, "Message_" + i)), i))
          .doOnNext(r -> log.debug("Message #{} result: {}", r.correlationMetadata(), r.recordMetadata()))
          .subscribe();
    

KafkaReceiver

    receiver.receive()
            .subscribe(r -> {
                log.info("Received message {} ", r);
                r.receiverOffset().acknowledge();
            });
    

More detailed documentation is available in the Reference Guide.

Skip navigation links
Reactor Kafka