GithubHelp home page GithubHelp logo

Comments (3)

edenhill avatar edenhill commented on May 19, 2024

You will need to set a dr_cb (delivery report callback) and then call rd_kafka_poll() to get indication if a message was delivered or not.

Use rd_kafka_conf_set_dr_cb(), you can look at examples/rdkafka_performance.c for an example.

Even if you dont set a dr_cb, librdkafka will respect your request.required.acks setting and make sure the message does indeed receive the requested number of acks, or else it will retry the transmission.

from librdkafka.

winbatch avatar winbatch commented on May 19, 2024

I'm pretty sure poll never returns 1 though if no callback is specified
which surprised me

On Friday, December 27, 2013, Magnus Edenhill wrote:

You will need to set a dr_cb (delivery report callback) and then call
rd_kafka_poll() to get indication if a message was delivered or not.

Use rd_kafka_conf_set_dr_cb(), you can look at
examples/rdkafka_performance.c for an example.

Even if you dont set a dr_cb, librdkafka will respect your
request.required.acks setting and make sure the message does indeed receive
the requested number of acks, or else it will retry the transmission.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-31282919
.

from librdkafka.

edenhill avatar edenhill commented on May 19, 2024

rd_kafka_poll() simply returns the number of internal events served, and not all of them depend on the application having configured a callback.
For instance if no error callback is configured the errors are converted into log messages instead.
So you shouldn't use the return value of rd_kafka_poll() to indicate any sort of produce message success, you need the delivery report callback (dr_cb) for that.

from librdkafka.

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.