The Traffic Processing SDK is designed to facilitate the handling of web server responses by logging the data and subsequently sending it to a Kafka producer. The project utilizes the librdkafka library for Kafka integration and libcpr for making HTTP requests to the server. It is as a CMake project.
The SDK captures and logs responses received from a web server.
The logged responses are sent to a Kafka producer for further processing and distribution.
-
traffic_processing_sdk.cpp:
- Main implementation of the Traffic Processing SDK.
- Functionality for creating a Kafka producer, handling signals for graceful termination, and making HTTP requests using the libcpr library.
-
CMakeLists.txt:
- CMake configuration file that sets up the project, specifies the C++ standard, and manages dependencies.
-
vcpkg Integration:
- Utilizes vcpkg to install and manage the librdkafka library.
- Configures the build to include necessary DLLs for Windows platforms.
-
Integration with Kafka (librdkafka):
- Uses librdkafka to interact with Kafka, providing the necessary configurations and linking libraries.
-
Integration with HTTP Requests (libcpr):
- Incorporates the libcpr library for making HTTP requests to the web server.
The project aims to be packaged as an SDK to facilitate plug-and-play integration into other applications. This modular approach allows developers to easily include traffic processing capabilities in their projects without extensive modifications.
Follow this link for detailed testing : https://docs.google.com/document/d/1PCtji7W9pUrobwRyat7FAOHtmiQ_1CTNT_ss1Tk8_ZA/edit?usp=sharing
Ensure you have CMake installed on your system
$ git clone https://github.com/vipulranjansahu/traffic_processing_sdk.git
$ cd traffic_processing_sdk
-
Install vcpkg (This is used because CMake build for librdkafka is unsupported): From inside the traffic_processing_sdk directory run:
$ git clone https://github.com/Microsoft/vcpkg.git $ cd vcpkg $ ./bootstrap-vcpkg.sh $ ./vcpkg integrate install
-
Install librdkafka:
$ ./vcpkg install librdkafka
From inside the traffic_processing_sdk directory run:
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
$ .\Debug\traffic_processor.exe <brokers> <topic>
- Note : If face any issue try rebuilding -Type URL and hit enter to make an HTTP request and produce a message to Kafka.