Giter VIP home page Giter VIP logo

Comments (3)

vlovgr avatar vlovgr commented on August 15, 2024 1

I've opened #93 to add those functions specifically, and #94 to track remaining functions.

from fs2-kafka.

vlovgr avatar vlovgr commented on August 15, 2024

Thanks for raising this issue @backuitist!

Currently the KafkaConsumer exposes only a tiny subset of all the apache kafka consumer methods.

That's correct, and it's mainly because no-one has asked for or implemented the remaining functions. It would be helpful if you could either (1) list the non-implemented functions you need, or (2) list all the non-implemented functions for reference, and we could track them here.

Wouldn't it be easier to provide an (albeit dangerous) withConsumer (similar to the one on KafkaConsumerActor) instead of actor style communication?

One of the design decisions is to not expose impure functions, which you would do indirectly by providing a withConsumer function. My preference is that we expose pure versions of those functions directly on KafkaConsumer instead.

Speaking of which, what's the purpose of the actor since you anyway synchronize calls to the underlying apache kafka consumer?

The initial implementation started out with the 'actor' approach, but then the synchronized construct was added to deal with finalizer behaviour (calling close on the Java Kafka consumer). You're right in that we can get rid of the actor approach, relying solely on Synchronized, but it simply has not been done yet. However, there needs to be some communication between the poll-loop and some of the requests (e.g. subscribe and fetch).

from fs2-kafka.

backuitist avatar backuitist commented on August 15, 2024

Thanks for the quick and thorough answer!
Right now my use-case is to read the last x events of a topic. Here are the methods of interest:

  • Set<TopicPartition> assignment();
  • void seekToEnd(Collection<TopicPartition> partitions); -- that one is easily implemented with endOffsets + seek

Potentially useful:

  • long position(TopicPartition partition);

from fs2-kafka.

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.