cppkafka | Modern C++ Apache Kafka client library | Pub Sub library

 by   mfontanini C++ Version: v0.3.1 License: BSD-2-Clause

kandi X-RAY | cppkafka Summary

kandi X-RAY | cppkafka Summary

cppkafka is a C++ library typically used in Messaging, Pub Sub, Kafka applications. cppkafka has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

cppkafka allows C++ applications to consume and produce messages using the Apache Kafka protocol. The library is built on top of librdkafka, and provides a high level API that uses modern C++ features to make it easier to write code while keeping the wrapper's performance overhead to a minimum.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              cppkafka has a low active ecosystem.
              It has 533 star(s) with 191 fork(s). There are 30 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 71 open issues and 106 have been closed. On average issues are closed in 103 days. There are 5 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of cppkafka is v0.3.1

            kandi-Quality Quality

              cppkafka has no bugs reported.

            kandi-Security Security

              cppkafka has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              cppkafka is licensed under the BSD-2-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              cppkafka releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cppkafka
            Get all kandi verified functions for this library.

            cppkafka Key Features

            No Key Features are available at this moment for cppkafka.

            cppkafka Examples and Code Snippets

            No Code Snippets are available at this moment for cppkafka.

            Community Discussions

            QUESTION

            How to build an example cppkafka using qmake & mingw?
            Asked 2020-Sep-01 at 12:05

            I need to get away from cmake, so I want to build a qmake project on mingw. Please help me understand what is missing. Build CPPKafka from https://github.com/mfontanini/cppkafka

            main.cpp

            ...

            ANSWER

            Answered 2020-Sep-01 at 12:05

            You need to add dllexport to the struct HandleDeleter and rebuild.

            before include\cppkafka\kafka_handle_base.h:

            Source https://stackoverflow.com/questions/63671349

            QUESTION

            CppKafka Consumer taking 5 seconds to initialise
            Asked 2020-May-02 at 07:32
            Description

            I'm trying to setup a Consumer and it is taking 5 seconds before initialization finishes and messages start getting received. I am using CppKafka (librdkafka wrapper), but I suspect it's a matter of me misconfiguring things rather than a library problem.

            I was previously using kafka inside of docker and the startup delay was 10 seconds. I am now using this quickstart on the Kafka website and the startup delay is now at 5 seconds.

            I have a ConsumeOne function that looks like this.

            ...

            ANSWER

            Answered 2020-May-02 at 07:32

            This is now fixed in master (https://github.com/edenhill/librdkafka/commit/c64b652689c20dc7f2ce71eaf7166d9806c25096)

            First message is now received between 80 - 100ms. Thanks for sorting it out!

            Source https://stackoverflow.com/questions/60560292

            QUESTION

            librdkafka not found by CMake
            Asked 2020-Feb-20 at 17:15

            I'm trying to use Kafka in a project that uses CMake to be built.

            I have librdkafka-dev (version 0.8.6-1.1) installed.

            I also tried downloading the project from Git and building it manually, which seem to be successful.

            I noticed a README.md file in the librdkafka/packaging/cmake and followed its instructions, successfully creating a CMake build of librdkafka in the directory.

            Running the 'cmake' command in my project results in the following error:

            ...

            ANSWER

            Answered 2020-Feb-20 at 17:15

            This solved itself. Apparently, this was a bug with the CppKafka library and was already solved by the developers.

            Source https://stackoverflow.com/questions/57599033

            QUESTION

            CMake linking to external project
            Asked 2019-Nov-09 at 06:39

            I am new to cmake and want to use the following external project in my program. (https://github.com/mfontanini/cppkafka) The idea is to download from git and build using cmake, which I have managed already. At the end of it, I am left with a .so file which I then have to link back to the main project. Any ideas on how I can achieve this ? Also, would like some suggestion on how to manage dependencies in a project with cmake that would possibly be carried forward to production.

            ...

            ANSWER

            Answered 2018-Dec-05 at 10:21

            You can use the ExternalProject of cmake.

            External project are downloaded in ${CMAKE_CURRENT_BINARY_DIR}/third-party

            You can perform actions on them as target.

            Source https://stackoverflow.com/questions/53629420

            QUESTION

            C++ with Kafka - consumer just receives some producer messages
            Asked 2018-Dec-04 at 14:35

            I'm using the following C++ code to produce messages to Kafka:

            ...

            ANSWER

            Answered 2018-Dec-04 at 14:35

            Original Comment:

            It is probably sort of spam prevention, i.e. sending messages out too quickly and the server is just ditching them

            There are lots of different anti-spam techniques developed by web server providers. This is to stop somebody spamming your server by sending tonnes of web traffic. I think this is likely what you are doing

            https://en.wikipedia.org/wiki/Anti-spam_techniques

            Source https://stackoverflow.com/questions/46707480

            QUESTION

            Kafka Protobuf: C++ serialization to java
            Asked 2018-Aug-23 at 06:21

            I've developed a couple of C++ apps that produce and consume Kafka messages (using cppkafka) embedding Protobuf3 messages. Both work fine. The producer's relevant code is:

            ...

            ANSWER

            Answered 2018-Aug-23 at 05:45

            You can read kafka as ConsumerRecords. And then SolidList.parseFrom(ByteBuffer.wrap(record.value().getBytes("UTF-8")));

            Source https://stackoverflow.com/questions/51968968

            QUESTION

            Read only last message from Kafka topic
            Asked 2018-Jul-06 at 01:59

            I am trying to send a video stream through a Kafka topic and doing some processing between each messages consumption. This processing takes approximately 20 milliseconds, so after 100 frames, I have a consequent latency. I can detect this latency, however, I need to be able to force my consumer to read from the latest sent frame from the moment the latency is detected. I am aware that this would lead to many frames skipped.

            I am using cppkafka which is based on librdkafka.

            I can't find a lead that will put me in the right path since most of the answers are either different from my problem or use concepts existing only in other languages APIs.

            Any thought on the matter ?

            ...

            ANSWER

            Answered 2018-Jul-06 at 01:59

            A simple, if kind of brute, way to do it is to check the number of frames in the queue you have. If above a certain upper threshold then do a tight loop where you "consume" and discard (i.e. does no processing at all) of the frames until you reach your lower threshold (in your case one).

            Once that tight loop is done you resume normal processing of the queue.

            Source https://stackoverflow.com/questions/51198703

            QUESTION

            Kafka consumer poll newest message
            Asked 2018-May-18 at 08:51

            I am using CppKafka to programming Kafka consumer. I want when my consumer starts, it will only poll new arrival messages (i.e message arrive after the consumer-start-time) instead of messages at consumer offset.

            ...

            ANSWER

            Answered 2018-May-18 at 08:51

            If "enable.auto.commit" is set as false and you do not commit offsets in your code, then every time your consumers starts it starts message consumption from the first message in the topic if auto.offset.reset=earliest.

            The default for auto.offset.reset is “latest,” which means that lacking a valid offset, the consumer will start reading from the newest records (records that were written after the consumer started running).

            Based on your question above it looks like auto.offset.reset=latest should solve your problem.

            But if you need a real time based offset you need to apply the time filter in your consumer. That means get the message from the topic compare offset time with either on some custom field in message payload or the meta attribute of the message (ConsumerRecord.timestamp())and do further processing accordingly.

            Also refer to this answer Retrieve Timestamp based data from Kafka

            Source https://stackoverflow.com/questions/50388690

            QUESTION

            How to link C++ Application with cppkafka
            Asked 2018-Apr-11 at 12:28

            As mentioned in the cppkafka official GitHub in usage section.

            If you want to use cppkafka, you'll need to link your application with:

            • cppkafka
            • rdkafka

            I tried to compile example program mentioned in the README.md of the GitHub with

            ...

            ANSWER

            Answered 2018-Apr-11 at 12:28

            No need of -D_GLIBCXX_USE_CXX11_ABI=0 option while compiling. you can simply compile this as following

            Source https://stackoverflow.com/questions/49753605

            QUESTION

            kafka consumer receiving overhead?
            Asked 2018-Feb-19 at 12:10

            I have a kafka consumer that does a poll every 10 seconds. I am using wireshark to monitor my network's acitvity.

            I noticed that even when I am not doing any fetch requests, there is still traffic between the broker and my consumer. And I also noticed that it is the same packets (almost the same, only a slight change to the payload) that are sent and received periodically.

            Is this some kind of keep alive packets? how to reduce them?

            Here is a screenshot of those packets:

            PS: I am using cppkafka as lib and kafka broker 0.8.2.2

            EDIT: The client's code

            ...

            ANSWER

            Answered 2018-Feb-16 at 14:43

            You probably see heartbeat messages to keep the consumer group alive, you can find more info about them here: https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-GroupMembershipAPI

            It's possible to adjust the heartbeat interval by modifying heartbeat.interval.ms, check the librdkafka configuration.

            Source https://stackoverflow.com/questions/48828167

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install cppkafka

            You can download it from GitHub.

            Support

            You can generate the documentation by running make docs inside the build directory. This requires Doxygen to be installed. The documentation will be written in html format at <build-dir>/docs/html/. Make sure to check the wiki which includes some documentation about the project and some of its features.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mfontanini/cppkafka.git

          • CLI

            gh repo clone mfontanini/cppkafka

          • sshUrl

            git@github.com:mfontanini/cppkafka.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Pub Sub Libraries

            EventBus

            by greenrobot

            kafka

            by apache

            celery

            by celery

            rocketmq

            by apache

            pulsar

            by apache

            Try Top Libraries by mfontanini

            libtins

            by mfontaniniC++

            Programs-Scripts

            by mfontaniniC

            dot11decrypt

            by mfontaniniC++

            ces

            by mfontaniniPython

            sloth-fuzzer

            by mfontaniniC++