The purpose of this assessment is to demonstrate the ability to use queues, edge services, Feign, caching, config servers, and Eureka in a project that requires to create new code and work with existing code.
Stwitter (Simple Twitter) is a stripped down social media service. The project was started as a proof of concept and the management team now wants to complete the system for use on the company intranet.
- All services must use the Config Server for their configuration settings.
- All services must register with Eureka.
- All web service to web service communication must be done using a Feign client.
- All services must have a complete set of unit/integration tests.
- All data must be cached as appropriate.
- The Stwitter API must be documented with Open API 3.x (Swagger).
- You must add JSR 303 validation and an exception handler for the controller.
Run the Config Server on port 1999.
Run Eureka in the standard configuration.
The Stwitter Service is the edge service with which end user applications (web and mobile) interact. End users are not aware of any other parts of the system.
Run the Stwitter Service on port 8889.
Post:
int: post ID
String: post content
LocalDate: post date
String: poster name
List<String>: comments
Comment:
int: comment ID
int: post id
String: commenter name
LocalDate: comment date
String: comment content
Create Post
===========
URI: /posts
HTTP Method: POST
RequestBody: Post data (minus ID)
ResponseBody: Post data (including autogenerated ID)
Get Post
========
URI: /posts/{id}
HTTP Method: GET
RequestBody: None
ResponseBody: Post data
Get Posts for Poster
====================
URI: /posts/user/{poster_name}
HTTP Method: GET
RequestBody: None
ResponseBody: Array of Post data
The Post Service is responsible for Post CRUD functionality.
Run the Post Service on port 1777.
create schema if not exists post;
use post;
create table if not exists post (
post_id int not null auto_increment primary key,
post_date date not null,
poster_name varchar(50) not null,
post varchar(255)
);
The Comment Service is responsible for Comment CRUD functionality.
Run the Comment Service on port 6868.
create schema if not exists comment;
use comment;
create table if not exists comment (
comment_id int not null auto_increment primary key,
post_id int not null,
create_date date not null,
commenter_name varchar(50) not null,
comment varchar(255)
);
The Comment Queue Consumer grabs new Comments off the queue and sends them to the Create Comment endpoint of the Comment Service.
Queue Name: comment-queue
Exchange Name: comment-exchange
Routing Key: comment.create.#