Giter Club home page Giter Club logo

Comments (5)

ozangunalp avatar ozangunalp commented on August 15, 2024 1

Indeed that phrase can use some clarification. Async processing in that case refers to processing where order is not preserved like Blocking with ordered=false, or RunOnVirtualThread.

The message loss scenario is not that complicated really:
Imagine receiving 3 records from a topic-partition with offsets 3,4,5 and they are concurrently processed. If the processing of 5 gets completed and it gets committed back to Kafka, you may have an error during processing 4 and you'd never receive it again, because you've already committed a later offset.

Throttled strategy prevents exactly this case by tracking processed offsets and committing offsets later.

Hope this clarifies.

from quarkus.

quarkus-bot avatar quarkus-bot commented on August 15, 2024

/cc @alesj (kafka), @cescoffier (kafka), @ozangunalp (kafka)

from quarkus.

quarkus-bot avatar quarkus-bot commented on August 15, 2024

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip

This message is automatically generated by a bot.

from quarkus.

vsevel avatar vsevel commented on August 15, 2024

thanks for the clarification. I can submit a doc PR if you want.
an alternative enhancement would be to provide a strategy "latest-consecutive-message" to avoid message loss. but I am not sure this would add a lot of value compared to throttled.

from quarkus.

pcasaes avatar pcasaes commented on August 15, 2024

Hi, I believe I wrote the original documentation. At that time with latest if the user's code returned a completed future before acking the record then data could be lost (the record's offset could be committed before processing actually takes place). With throttled that is not the case since the offsets are updates only after acking. This presupposes an async method signature:

@Incoming("my-data")
@Acknowledgment(Acknowledgment.Strategy.MANUAL)
public CompletionStage<Void> process(Message<MyData> message) {

 // ack message out of order on some other vertx context, executor thread, etc.

  return CompletableFuture.completedFuture(null);
}


EDIT: latest will commit on ack, so if the user processes out of order then that's when data can be lost. User requests 3 records and receives them with offsets 1,2.3. User only acks 3, Latest will commit to 3+1 even though the previous 2 records haven't been acked yet. Throttled on the other hand will wait until 1 and 2 are acked before committing to 3+1.

from quarkus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.