This project showcases a fundamental Kafka architecture implemented with a producer and consumer in a microservices environment. It serves as a foundation for leveraging Kafka in event-driven communication.
- Docker Compose: Easily spin up a local Kafka and Zookeeper cluster.
- Producer (ApiGateway): Publishes messages to a topic ("transaction-topic").
- Consumer (ApiConsumer): Listens for messages and logs them.
- Decoupled Microservices: Services communicate asynchronously through events, enhancing independence and scalability.
- Scalability: Kafka efficiently handles high volumes of messages.
- Fault Tolerance: Messages are persisted, ensuring delivery even if services are unavailable.
-
Clone the repository:
git clone https://github.com/kay-verma/Microservice-Messaging-with-Kafka.git
-
Build and run Docker containers:
docker-compose up -d
- Extend the consumer to perform actions based on message content (e.g., send emails, update databases).
- Implement complex workflows by chaining messages to other topics.
- Integrate with your existing microservices to enable event-driven communication.