Coder Social home page Coder Social logo

Comments (4)

edenhill avatar edenhill commented on July 20, 2024 2

Connection errors are treated as temporary errors and librdkafka will retry connecting to its known brokers indefinately.
Given that the application is configured with a correct broker list it is advised for an application not to take any action when a broker goes down since it will most likely come back up sooner or later, or another broker will assume leadership of the given partitions, so the library and application will eventually pick up where it left off.

Instead you should try to define your application-specific constraints in time:

  • how long is it okay for a consumer application not to see any new messages?
  • how long may the producer try to deliver a message for the application? (message.timeout.ms)

And let the underlying client operate without interruption within those bounds, abstracting your application from Kafka specific know-how.

Anyway, if you're not buying into this, or maybe just curious, you can look for the kafka.Error event.
You will be interested in the ErrTransport and ErrAllBrokersDown events.

from confluent-kafka-go.

shreyas-srinivas avatar shreyas-srinivas commented on July 20, 2024 1

@mcandre What if the broker is not down but the client is unable to connect due to a misconfiguration of the broker address. Unless we get a failure event it's not possible for us to know about the problem.

from confluent-kafka-go.

mcandre avatar mcandre commented on July 20, 2024

Thanks for the detailed explanation, that's a good way to treat these errors.

from confluent-kafka-go.

xin-au avatar xin-au commented on July 20, 2024

librdkafka will retry connecting to its known brokers indefinately.
Hi @edenhill , wondering is there a way to config it? Like how often to retry connecting to broker?

from confluent-kafka-go.

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.