Comments (3)
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.
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.
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)
- Cannot pull using consumer HOT 1
- poll_batch does not trigger commit when auto.commit is true ? HOT 1
- How to remove topic using the API
- Consumer misbehavior with newer librdkafka versions HOT 1
- Can't build tests on Ubuntu 22.04 (Jammy)
- produer success but kafka shell consumer all "null" HOT 1
- How to use BufferedProducer to send binary data?
- Dll import function not allowed
- create BufferedProducer<std::string> producer globally
- Is there any way to build it without "boost"? HOT 1
- Please help me, I have tried a variety of methods to compile, all failed, including using the method provided by chatGPT 4.0. also failed. HOT 1
- How to set ttl?
- How to get number of messages in the topic?
- add_library(Rdkafka::rdkafka) issue
- CPPKafka crashes when trying to create a configuration in Windows
- What happens if Kafka was offline ? HOT 1
- Automate Compilation of "examples" in Build Process
- warning: object backing the pointer will be destroyed at the end of the full-expression
- cppkafka::produce not flushing
- clang complains about parameter used in std::atomic_flag constructor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppkafka.