Giter Site home page Giter Site logo

Comments (5)

warrenfalk avatar warrenfalk commented on June 9, 2024

Nevermind. It appears that it is actually Kafka that is failing to send the response to the metadata request after the fetch request.

from kafka-net.

warrenfalk avatar warrenfalk commented on June 9, 2024

OK, after more investigation, there is actually a problem with kafka-net. The problem is that a kafka broker (in 0.8.2.1 at least) will not process a produce request while a fetch request is waiting for data. This is a problem with kafka-net because as soon as it yields the results of one fetch request, it sends a new fetch request immediately in another thread. This ultimately makes it impossible to use the BrokerRouter to do any publishes that end up being sent to the same broker.

Note: I think this is really poor behavior by Kafka. Its network protocol is described as though it could work this way (with correlation ids and all) but it does not seem to work that way.

from kafka-net.

warrenfalk avatar warrenfalk commented on June 9, 2024

In fact, they document that it does not work this way because all requests on a particular socket are ordered:

"The server guarantees that on a single TCP connection, requests will be processed in the order they are sent and responses will return in that order as well. The broker's request processing allows only a single in-flight request per connection in order to guarantee this ordering. Note that clients can (and ideally should) use non-blocking IO to implement request pipelining and achieve higher throughput. i.e., clients can send requests even while awaiting responses for preceding requests since the outstanding requests will be buffered in the underlying OS socket buffer. All requests are initiated by the client, and result in a corresponding response message from the server except where noted."

from kafka-net.

warrenfalk avatar warrenfalk commented on June 9, 2024

See discussion here: http://www.mail-archive.com/[email protected]/msg27430.html

This reply suggests that Consumers and Producers should actually not reuse the connection used by the BrokerRouter at all, and each instance should create its own connection for fetch/produce requests. The claim by the protocol wiki page that you should only ever need one connection between each broker and a client is no longer true and is going to be removed. The new Java consumers will all maintain their own connections.

from kafka-net.

Jroland avatar Jroland commented on June 9, 2024

Thanks warren, ill have a close read of that. Got pretty sick the last several weeks. So I am just getting back into things now.

from kafka-net.

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.