Comments (6)
That sounds like a reasonable thing, I will add it to the library.
Thanks.
from librdkafka.
Much appreciated. Note I just started with librdkafka, so expect more
questions and bug reports from me :)
On Fri, Dec 27, 2013 at 6:21 AM, Magnus Edenhill
[email protected]:
That sounds like a reasonable thing, I will add it to the library.
Thanks.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-31256971
.
from librdkafka.
I've verified that this already works as intended, but you need to call rd_kafka_poll() at regular intervals to let it call your error callback -(error_cb).
It will call the error callback with err set to RD_KAFKA_RESP_ERR__RESOLVE.
I.e.:
ERROR CALLBACK: rdkafka#consumer-0: Local: Host resolution failure: Failed to resolve 'false.edenhill.se:9092': Name or service not known
You can verify this behaviour with rdkafka_performance:
./rdkafka_performance -C -t topic -p 0 -b bad.host.name -I
from librdkafka.
Added a rd_kafka_poll() immediately after rd_kafka_brokers_add() and it worked perfectly. thanks! (Note, I had to do a poll with a timeout rather than -1 because when the broker list is good, the poll hangs. Not sure if this is expected or not).
from librdkafka.
The RESOLVE error callback will be triggered when the resolve fails, and depending on DNS configuration, network latency, resolver cache, etc, this may be anything from 1ms to 5 minutes, it really depends on the system setup.
Doing a poll(-1) means to wait forever, which is not what you want, and you cant really use a predefined timeout either for the above reasons.
I suggest that your application should assume that the provided brokers are correct, and if they are not and an error callback for RESOLVE is triggered, you handle the problem there, even if it is a bit late.
from librdkafka.
If you need to check that the brokers resolve you could resolve them yourself and provide them with numerical ip address to rd_kafka_brokers_add() or "metadata.broker.list" config property.
from librdkafka.
Related Issues (20)
- The lib can't work on windows. HOT 2
- `rd_kafka_offsets_store` with `rd_kafka_commit` does not preserve metadata on `NULL` HOT 1
- Question regardless blocked signals in threads HOT 6
- Onprem SQL to AWS Confluent Cloud Kafka "Not selecting any broker for cluster connection" HOT 1
- producer continually refreshing client metadata after broker disconnection HOT 8
- APIVERSION_QUERY timeout in first connection with TLSv1.3 kafka broker
- mklove/modules/configure.base: line 2126: source: configure.self: file not found on windows HOT 3
- Consumer initialization hangs HOT 1
- rd_kafka_metadata can cause a UNKNOWN_TOPIC_OR_PART message HOT 10
- Expose `rd_kafka_global_init` to prevent forking issues on macOS HOT 7
- librdkafka cannot be built with LLD linker HOT 2
- Upgrade CMake minimum version
- Issue with Confluent Kafka Python and MSK: "metadata information unknown" HOT 1
- Message is 'stuck' when the network cable is unplugged
- adminClient describeConsumerGroups leads to python: rdkafka_queue.h:1052: rd_kafka_enq_once_del_source_return: Assertion `eonce->refcnt > 0' failed. HOT 2
- Producer never reconnects to broker HOT 3
- ListOffsets loop of failed requests on leader epoch change until timeout happens HOT 3
- Question: Can event_cb be called on a stopped producer/consumer? HOT 1
- Data race in `rd_kafka_broker_timeout_scan`
- rd_kafka_produceva: double free headers on message sending error HOT 2
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 librdkafka.