We introduce a recipe for creating resilient Kafka consumers using Reactor Kafka. This approach is one that we’ve developed over time and incorporates the learnings from our experience with running Reactor Kafka – and all the challenges that come with that. The consumer described in this article provides at-least-once delivery semantics using manual acknowledgments, which is mostly suited for applications where data loss is not acceptable. However, most of the concepts described here still apply to other types of delivery semantics supported by the framework.
The configuration class defines the properties to be used by the Kafka consumer, after which it uses them to instantiate a KafkaReceiver that will be made available as a bean in the application context.