As its name suggests, this service is responsible for handling the employees of a company. The application must expose a REST API. It should contain endpoints to:
-
Create a department
- Id (auto-increment)
- Name
-
Create an employee with the following properties:
- Uuid (generated automatically)
- Full name (first and last name)
- Birthday (format YYYY-MM-DD)
- Employee’s department
-
Get a specific employee by uuid (response in JSON Object format)
-
Update an employee
-
Delete an employee
Whenever an employee is created, updated or deleted, an event related to this action must be pushed in Kafka. This event will be listened to by the event-service
.
- The
email field
is unique, i.e. 2 employees cannot have the same email.
- Docker/Docker Compose
- Maven
- JDK 1.8
- Git client
- Checkout the bob-challenge-employee-service and bob-challenge-event-service projects from github. Make sure you select the naveen branch.
- Naviagte to the root folder of the bob-challenge-employee-service project. Launch the supporting services: ZooKeeper, Kafka and MySQL database by running the command: docker-compose up -d
- Open the bob-challenge-employee-service project in an IDE like Eclipse/STS. Launch the application as a SpringBoot project.
- Open the bob-challenge-event-service project in an IDE like Eclipse/STS. Launch the application as a SpringBoot project.
Employee service resources:
- Fetch all employees: http://localhost:8181/employee-service/api/employees
- Fetch an employee by Id: http://localhost:8181/employee-service/api/employee/{employeeId}
- Fetch all departments: http://localhost:8181/employee-service/api/departments
- Fetch a department by Id: http://localhost:8181/employee-service/api/department/{departmentId}
- OpenAPI specification: http://localhost:8181/employee-service/v3/api-docs/
Employee event service resources:
- Fetch an event by Id: http://localhost:8182/event-service/api/event/{eventId}
- Fetch all events: http://localhost:8182/event-service/api/events
- OpenAPI specification: http://localhost:8182/event-service/v3/api-docs/