Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request includes required changes to migrate from Mongo DB to Kafka to the following files:
The specific changes I made regards the codebase structure:
logs
directoryTesting
I have tested these changes using Docker compose to set up a Kafka cluster with three brokers and one apache zookeeper. To test the changes, I did the following:
docker-compose up -d
command making sure I'm in the working directory wheredocker-compose.yaml
file located.Kafka Offset Explorer
a GUI tool for managing apache Kafka and then configured it according to my Kafka cluster configurations made sure it connected successfully before moving to the next step.pip3 install -r requirements.txt
command.PYTHONPATH
environment variable by usingexport PYTHONPATH=$PWD
command.'bootstrap.servers': 'localhost:29092,localhost:39092,localhost:49092'
Notice these ports are hardcoded in thedocker-compose.yaml
file.stream_batch.py
that generate streaming data into Kafka topics in the Kafka Cluster.logs
directory to track the processes while they're running.I have confirmed that the changes are working as intended and the data is being loaded into the Kafka cluster correctly.
Impact
These changes will migrate the code from Mongo DB to Kafka and making a unified logs directory, make it easier to add new features in the future, and update the dependencies and configuration files.
Additional Notes
To set up the environment for testing these changes, I used Docker to create multiple containers through docker-compose with necessary dependencies. To install Docker, I followed the instructions on the Docker website in addition to installing docker-compose on local machine, I followed the instructions on the Docker compose installation
To be able to test Kafka cluster visually through a friendly graphical user interface, I used Kafka Offset Explore for this mission. To install Kafka Offset Explorer I downloaded it from Kafka Offset Explore Site it's available on all operating systems.