You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for all the work you put into this project.
I'm currently using Spring WebFlux together with reactor-kafka, and I'm trying to understand what the recommended pattern is now that Reactor Kafka and the reactive Kafka binder are being discontinued.
Previous setup (with Reactor Kafka)
Previously, my pipeline looked roughly like this (simplified):
An end-to-end reactive pipeline (DB + HTTP, all based on Mono/Flux)
At-least-once semantics (ack only after processing)
A clear way to bound in-flight work via flatMap(..., concurrency) and Reactor Kafka’s backpressure.
Now that Reactor Kafka is being discontinued, I'm looking for the idiomatic way to do something similar using Spring Kafka only, but still staying “reactive” inside the processing.
Current idea: @KafkaListener returning Mono<Void>
Based on the reference docs for asynchronous @KafkaListener return types, my understanding is:
A @KafkaListener method can return Mono<?> or CompletableFuture<?>.
When an async return type is detected, the container automatically:
switches the AckMode to MANUAL, and
enables out-of-order commits / async acks,
and will ack the record when the Mono/future completes.
Until all records from the previous poll are committed, the consumer is paused so no new records are delivered.
Given that, my current candidate implementation looks like this:
Reactive processing (WebFlux, R2DBC, WebClient, etc.) inside the listener
Bounded in-flight work: effectively “up to 32 records in flight per consumer instance”, controlled by max-poll-records and concurrency.
Questions
Is this pattern (async @KafkaListener returning Mono<Void>) considered the recommended way to integrate Spring WebFlux–style reactive processing with Spring Kafka now that Reactor Kafka is discontinued?
In other words, is this the preferred path going forward for reactive pipelines without depending on reactor-kafka?
For bounding in-flight work, is it correct to rely on:
max.poll.records × concurrency as the effective upper bound of in-flight records per application instance, and
the container’s automatic pausing (with async acks) to prevent the consumer from pulling more records until the previous poll’s records are all committed?
In a high-load / high-backlog scenario, would you recommend:
just tuning max.poll.records, concurrency, and max.poll.interval.ms along with the async listener,
or do you still recommend using explicit pause() / resume() from application code for more control when using WebFlux-heavy processing?
Are there any official samples, reference projects, or more detailed documentation that show an end-to-end pattern for “Spring WebFlux + Spring Kafka (without Reactor Kafka)” with at-least-once semantics and bounded concurrency?
If not, would such a sample be something you’d be interested in accepting as a contribution?
I want to make sure I’m not over-engineering this, and that I’m aligning with the Spring Kafka team’s intended direction for reactive usage now that Reactor Kafka and the reactive binder are being phased out.
Any guidance or confirmation would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Spring Kafka team,
First of all, thank you for all the work you put into this project.
I'm currently using Spring WebFlux together with reactor-kafka, and I'm trying to understand what the recommended pattern is now that Reactor Kafka and the reactive Kafka binder are being discontinued.
Previous setup (with Reactor Kafka)
Previously, my pipeline looked roughly like this (simplified):
This gave me:
Mono/Flux)flatMap(..., concurrency)and Reactor Kafka’s backpressure.Now that Reactor Kafka is being discontinued, I'm looking for the idiomatic way to do something similar using Spring Kafka only, but still staying “reactive” inside the processing.
Current idea:
@KafkaListenerreturningMono<Void>Based on the reference docs for asynchronous @KafkaListener return types, my understanding is:
@KafkaListenermethod can returnMono<?>orCompletableFuture<?>.AckModeto MANUAL, andMono/future completes.Given that, my current candidate implementation looks like this:
Configuration-wise (simplified):
My goal here is:
max-poll-recordsandconcurrency.Questions
Is this pattern (async
@KafkaListenerreturningMono<Void>) considered the recommended way to integrate Spring WebFlux–style reactive processing with Spring Kafka now that Reactor Kafka is discontinued?In other words, is this the preferred path going forward for reactive pipelines without depending on
reactor-kafka?For bounding in-flight work, is it correct to rely on:
max.poll.records×concurrencyas the effective upper bound of in-flight records per application instance, andIn a high-load / high-backlog scenario, would you recommend:
max.poll.records,concurrency, andmax.poll.interval.msalong with the async listener,pause()/resume()from application code for more control when using WebFlux-heavy processing?Are there any official samples, reference projects, or more detailed documentation that show an end-to-end pattern for “Spring WebFlux + Spring Kafka (without Reactor Kafka)” with at-least-once semantics and bounded concurrency?
If not, would such a sample be something you’d be interested in accepting as a contribution?
I want to make sure I’m not over-engineering this, and that I’m aligning with the Spring Kafka team’s intended direction for reactive usage now that Reactor Kafka and the reactive binder are being phased out.
Any guidance or confirmation would be greatly appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions