"eCupcakesFactoryOnContainers" is based on a simplified "Microservices" architecture and docker containers. Core intent of this reference application is to provide reference implementation for .Net developers to easily get started with containerized microservices using .Net Core and Kafka.
"eCupcakesFactoryOnContainers" is based on a simplified "Microservices" architecture and docker containers. Core intent of this reference application is to provide reference implementation for .Net developers to easily get started with containerized microservices using .Net Core and Kafka.
It's a fictional cupcake factory usecase mentioned in my colleague William Scott's blog post on event streaming, please read his blogpost before you start looking into this sample codebase.
Note: we haven't implemented ApiGateway yet, but it will be added in future releases. Right now all Apis/Services are accessed directly from UI.
Notes: Kubernetes implementation is in "gcpmigation" branch of this repository.
Download and Start Confluent Platform: https://docs.confluent.io/current/quickstart/ce-quickstart.html
Using docker: It's easy to setup KAFKA in local using docker containers. Clone the below below repository and run "docker-compose up" command.commands:
Commands:
git clone https://github.com/confluentinc/cp-docker-images
cd cp-docker-images
git checkout 5.2.1-post
cd examples/cp-all-in-one/
docker-compose up -d --build
Above instructions should start a KAFKA server, and you can use the broker localhost:9092 to produce/consumer messages.
Creating a new topic in local KAFKA: producing a sample message to a topic using kafkacat utility would create topic if it doesn't exist.
kafkacat -b localhost:9092 -t new_topic -P
RESTful Api that takes users orders and responds back immediately with some acknowledgement info.
Example:
Curl -i -H "Content-Type: application/json" -X POST -d '{"Order":{"Flavour":"Strawberry","Quantity":1,"Size":1}}' http://localhost:5000/api/v1/order
**Refer src/Api/README.md for more details.
These services continually monitors KAFKA topics and push notifications to all connected clients(i.e react-ui here) about the newly received orders/updates to existing orders.
SingnalR Endpoint&Actions:
http://localhost:5002/ordermonitorhub
"InformNewOrderToBake"
"InformNewOrderToMix"
"InformNewOrderToDecorate"
"InformNewOrderToPackage"
Note: why do we need SignalR here? Though Kafka is pub/sub system, there is no direct browser client available. So we need something like SignalR to push these notifications to UI clients.
Provides web interfaces
urls:
customer: http://localhost:3000/create
mixer: http://localhost:3000/mixer
baker: http://localhost:3000/baker
decorator: http://localhost:3000/decorator
packaging team: http://localhost:3000/packaging
Admins:
http://localhost:3000/dashboard
Refer src/kafka-mongodb-connector/README.md for more details.
Refer kafka-mongod-cdc/README.md for more details.
Clone this repository:
git clone https://github.com/srigumm/eCupcakesFactoryOnCotainers.git
cd eCupcakesFactoryOnCotainers
Install kafka and create kafka topics(use control-center or kafkacat util):
"orderrequests"
"readytobake"
"readytodecorate"
"readytobox"
"readytoship"
Example:
kafkacat -b localhost:9092 -t orderrequests -P
Running in Local Machine using Docker:
"docker-compose up"
executing this command at root directory should be enough to start the whole system ( it builds all required docker images and containers in localbox).
on successful run, you can access your UI/Services at the below endpoints:
<script src="https://gist.github.com/sgummadidala/a4de154e56b6b747289c1e82d548e2b7"></script>Demo@Meetup https://www.youtube.com/watch?v=xNAZWHtakoQ&feature=youtu.be&t=2912
Demo: https://www.youtube.com/watch?v=BQe6tDDEyjs&feature=youtu.be