Giter VIP home page Giter VIP logo

Comments (3)

mfontanini avatar mfontanini commented on August 21, 2024

Can you expand on how it asynchronously throws? I tried using a bogus broker endpoint and it kept running forever trying to reconnect and never crashed. Can you show exactly what you're doing?

Using zookeeper is deprecated IIRC. On newer kafka versions the preferred way is having at least one broker endpoint and if there are more, the rest will be automatically discovered.

from cppkafka.

erikbasargin avatar erikbasargin commented on August 21, 2024

If I understand you correctly, then when you call producer.flush() the exception throws.
I have this happen when the server is down, etc. I'm wrapping producer.flush() in block try { producer.flush(); } cach (...) {}.

And I set up callback:

  • set_delivery_report_callback([&](cppkafka::Producer &, const cppkafka::Message & message) {...})
  • set_error_callback([&](cppkafka::KafkaHandleBase &, int error, const std::string & reason){...})

In the first case, I look at the errors, not including 0 (success delivery) and -191 (for more information on errors, see message.h and rdkafka.h) - message.get_error().

In the second case, it is intuitively clear :).

Unfortunately, how to determine that the connection is successful without using the first callback I do not know. The very issue of concern.

from cppkafka.

mfontanini avatar mfontanini commented on August 21, 2024

Sorry it took me ages to reply. I think this question is more suitable to be done on the librdkafka repo as it seems to be implementation specific.

from cppkafka.

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.