Course micro service
Description : Designed course and student microservices as per CodingTest-Microservice.pdf
-
-
create account
-
create database : coursedb
-
create document : course
-
document will be added automatically by spring bootstrap class
{"_id":{"$oid":"5ded9404529f3268634654c4"},"courseId":{"$numberInt":"1"},"title":"ML","description":"Machine Learning","active":true,"fee":{"$numberDouble":"1500"},"_class":"com.example.demo.document.Course"}
-
-
Course micro service will be sender/publisher to queue StudentAQ and StudentRQ
-
Install RabbitMQServer from official website.
-
After installation check service status in start-> run -> services.msc
-
Observation: Status: Running, Startup type: Automatic
-
Note:The pre-requisite for RabbitMQ is Erlang. (Install OTP_win64_19.3.exe from softwares folder
- D:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.9\sbin>rabbitmq-plugins enable rabbitmq_management
- login local rabbitmq admin console @ http://localhost:15672 user:guest pass:guest
public final static String QUEUE_ROUTINGKEY_ADD = "routingKeyadd-boot"; public final static String QUEUE_ROUTINGKEY_REMOVE = "routingKeyremove-boot"; public final static String EXCHANGE_NAME = "spring-boot-exchange"; private final static String QUEUE_NAME_1 = "StudentAQ"; private final static String QUEUE_NAME_2 = "StudentRQ";
-
-
* clean install spring-boot:run
-
* GET METHOD : http://localhost:8081/course/get * DELETE METHOD : http://localhost:8081/course/remove?courseID=4 * POST METHOD : http://localhost:8081/course/add/ * REQUEST PAYLOAD : { "courseId": 4, "title": "AWS", "description": "Amazon Web Service, "active": true, "fee": 900 } * Content-type : application/json
-
- Using URL suffixes (extensions) in the request (eg .xml/.json)
- Using URL parameter in the request (eg ?format=json)
- Using Accept header in the request
By default, this is the order in which the Spring content negotiation manager will try to use these three strategies. And if none of these are enabled, we can specify a fallback to a default content type of json.
- swagger core is implemented and available @ http://localhost:8081/v2/api-docs