- Clone the repository
- Install dependencies
- Install a single node kafka cluster by typing
docker compose up -d
- View and manage your Kafka cluster with Kafdrop by visiting
http://localhost:19500
- Start a backend server by typing
npm start
- Use Postman or any similar tool to send requests to
http://localhost:8080
- To create a new topic, send a POST request to
http://localhost:8080/kafka/create_topic
with payload{"topicName": "any_topic_name", "numPartitions": "any_number"}
- To publish a message to a topic, send a POST request to
http://localhost:8080/kafka/publish
with payload{ "topicName": "existing_topic", "message": { "key": "my_key", "value": "message_content" } }
- To consume a topic message, send a POST request to
http://localhost:8080/kafka/consume
with payload{"topicName": "your_topic_name"}
- Have fun
-
Notifications
You must be signed in to change notification settings - Fork 0
senghor/express-kafka
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
How to get started with Kafka, NodeJS & ExpressJS
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published