See Description for full task requirements.
See Setup Instructions to get the project running
-
comment-service
-
Exposes REST API to submit and retrieve paginated comments
-
Stores comments in MongoDB
-
Publishes new comments to Kafka via transactional outbox
-
-
notification-service
-
Maintains WebSocket connections with clients
-
Consumes messages from Kafka
-
Publishes to Redis Pub/Sub for all client fanout
-
Forwards comments to connected clients in real time
-
-
Kafka is used to propagate new comments between services
-
Redis Pub/Sub enables WebSocket fanout to multiple clients
-
Client submits a comment to
comment-service -
Comment is stored in MongoDB
-
Event is published to Kafka
-
notification-serviceconsumes the message -
The comment is pushed to Redis Pub/Sub
-
Connected WebSocket clients receive the update
From the root directory, run:
./gradlew clean buildThis builds all microservices and runs integration tests.
Use Docker Compose to spin up Kafka, Redis, MongoDB, and all services:
docker-compose up --build -dWait until all services are running (Kafka topic will be auto-created).
The Docker Compose setup includes:
-
comment-service: REST API + MongoDB storage + Kafka producer -
notification-service-1andnotification-service-2: Kafka consumers + Redis publishers + WebSocket push -
kafka: With 2 partitions for comment events -
redis: For broadcasting to clients via Pub/Sub -
mongo: For comment persistence
Two instances of notification-service are used to simulate partitioned Kafka consumption. Each instance processes messages from one partition (same consumer group), and both publish to Redis. This lets all WebSocket clients receive all comments — no matter which partition they were sent to.
Open two or more browser windows and navigate to:
http://localhost:8080/client.htmlhttp://localhost:8080/second-client.htmlEach browser will:
- Assign a unique anonId via localStorage (better set to 1 and 2 manually, to check fanout)
- Load existing comments from the backend
- Establish a WebSocket connection for real-time updates
You can test by submitting a comment in one tab and seeing it appear in the others.
If you want to run E2E Selenium tests:
./gradlew e2eTestAllNote: Docker Compose must be running.
Build a service that will provide us with basic functionality to manage web page comments.
-
Create a simple webpage (e.g., page.html) with a minimal UI design that will:
-
List all available comments
-
Have an input field to add a new comment
-
-
Create the backend endpoints to facilitate the need for the above page
-
Adding a comment must be an asynchronous operation
-
The application should store the comments in a database
-
The application should push the comments to the client’s browser and displayed in a UI
-
The system must be composed of two or more microservices communicating over a messaging system
-
Design an event-driven and scalable architecture. Services need to have clear responsibilities and well-defined contracts.
-
The services should be written in Java using the Spring Boot framework
-
The services should have the necessary testing coverage
-
Push the project’s source code and its documentation to the git repository provided.
-
Documentation must include detailed information on how to deploy and run the project.
-
The exercise will be evaluated mainly based on:
-
Design patterns used
-
Test strategies used (consider adding integration test or automated end-to-end test or propose a manual test flow)
-
Test coverage and good development practices used
-
Understanding and usage of messaging systems
-
-
UI is not the main objective of this task. You can use any technology and make it simple, but it must be functional enough.
-
Push the code to the repository After completing a component or milestone to avoid one big bang.
-
Do not worry if you haven’t completed all the task parts. We have all been here before.
-
Reach out to us if you have any questions.