Giter Site home page Giter Site logo

ocaml-kafka's People

Contributors

anmonteiro avatar dependabot[bot] avatar didier-wenzek avatar frejsoya avatar leonidas-from-xiv avatar marctrem avatar rgrinberg avatar rr0gi avatar vbmithr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ocaml-kafka's Issues

Create a 0.1 tag for publishing to OPAM

Hey, I saw this project in r/ocaml and wanted to try it out. A quick opam search showed that this project isn't yet available there.

I was wondering if you consider this project to be worthy of a 0.1 version and would be happy to have it published on OPAM. I've done some of the initial legwork to create an opam package. To complete that I need a tag created in this repo as explained here which will create a tar.gz file for that version.

After that I can create a PR against OPAM and get this project added there.

Cheers

job_consume leak

extern CAMLprim
value ocaml_kafka_consume_job(value caml_kafka_topic, value caml_kafka_partition, value caml_kafka_timeout)
{
  struct job_consume* job = (struct job_consume*)lwt_unix_new(struct job_consume);

but there is no corresponding free afaics?

rd_kafka_conf leak

  if (conf_err) {
     rd_kafka_conf_destroy(conf);
     RAISE(RD_KAFKA_CONF_RES(conf_err), "Failed to configure new kafka consumer (%s)", error_msg);
  }

  rd_kafka_t *handler = rd_kafka_new(RD_KAFKA_CONSUMER, conf, error_msg, sizeof(error_msg));
  if (handler == NULL) {
     RAISE(RD_KAFKA_RESP_ERR__FAIL, "Failed to create new kafka consumer (%s)", error_msg);
  }

this leaks rd_kafka_conf when rd_kafka_new fails

Request: new release

Hey!

The latest release is from 2020. Can we create a new version (0.6)? Thanks!

Ubuntu 14.04

I'm unable to compile this on Ubuntu 14.04. I tried posting the error on discord but haven't been able to figure out

#=== ERROR while compiling kafka.0.4 ==========================================#
# context     2.0.7 | linux/x86_64 | ocaml-base-compiler.4.05.0 | https://opam.ocaml.org#c23dfbd9
# path        ~/locations-consumer/_opam/.opam-switch/build/kafka.0.4
# command     ~/.opam/opam-init/hooks/sandbox.sh build jbuilder build -p kafka -j 1
# exit-code   1
# env-file    ~/.opam/log/kafka-25955-d2c37b.env
# output-file ~/.opam/log/kafka-25955-d2c37b.out
### output ###
# ocaml_lwt_kafka.c:112:3: warning: implicit declaration of function ‘rd_kafka_consume_queue’ [-Wimplicit-function-declaration]
# [...]
# ocaml_lwt_kafka.c:112:16: warning: assignment makes pointer from integer without a cast [enabled by default]
#    job->message = rd_kafka_consume_queue(job->queue, job->timeout);
#                 ^
# ocaml_lwt_kafka.c: At top level:
# ocaml_lwt_kafka.c:241:3: error: unknown type name ‘rd_kafka_queue_t’
#    rd_kafka_queue_t *queue;
#    ^
# ocaml_lwt_kafka.c: In function ‘worker_consume_batch_queue’:
# ocaml_lwt_kafka.c:255:3: warning: implicit declaration of function ‘rd_kafka_consume_batch_queue’ [-Wimplicit-function-declaration]
#    job->actual_msg_count = rd_kafka_consume_batch_queue(job->queue, job->timeout, job->messages, job->msg_count);

Thanks!

Publish kafka_async

Are there plans to publish kafka_async? I'm going to have trouble convincing folks to pin an unpublished version of this library

delivery_callback is GC unsafe

  if (Is_block(caml_delivery_callback)) {
     caml_callback = Field(caml_delivery_callback, 0);
     rd_kafka_conf_set_opaque(conf, (void*) caml_callback);
     rd_kafka_conf_set_dr_cb(conf, ocaml_kafka_delivery_callback);
  } 

this stores OCaml value in the C structure without registering as GC root

Kafka_lwt.consume_batch is not thread-safe

I observe memory corruption when trying to run Kafka_lwt.consume_batch on the same topic object but different partitions in two Lwt threads. Is it supposed to work like this?

The custom partitioner callbacks are not invoked

The partitioner callback set when a topic producer is created is not used when messages are produced with no partition assigned.

Setting a partitioner callback as in:

let partitioner_callback partition_cnt key = Some ((Hashtbl.hash key) mod partition_cnt) in
let topic = Kafka.new_topic ~partitioner_callback producer topic_name options in                                                                                                                                 
Kafka.produce topic ~key msg

we expect that the partitioner_callback is called for each message produced without a partition.
Actually, the custom callback is never invoked and the partition is assigned using the partitioner set by the partitioner property

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.