Step by Step Create A Miscroservice
- Posted on
- Microservices
- By Deepak Talwar
Microservices are an architectural method of software development in which applications are constructed as a set of small, independent, and loosely connected services.
Well-defined APIs let these services talk with one another via a network. Usually owned by a small, self-contained team, each service can be delivered and scaled separately.

SET ENVIRONMENT
- Step 1: Prepare for micro services (see here)
- Step2 : Create Blank Repository and clone it at your local (see here)
- Step3: Create First Application On Micro-service and Configure (see here)
- Step4: Download MongoDB Image and Create Container (see here)
- Step5: Follow Some Design Pattern before proceeding (Vertical Slice Architecture), (CQRS Design Pattern) and (Mediator pipeline process & behavior using MediatR)
- Step7: Create Vertical slice architecture in Catalog Micro service
- Step6: Create a separate Class Library for all commands Reference and external libraries
- Step8: MANAGE HANDLERS in Separate Class Library for Microservice
- Step8: MANAGE ENDPOINTS in Catalog Microservice
- Step9: Manage Entity Mappings in Separate Class Library for Microservice
- Step10: Use External Class Library interfaces into Catalog Microservice
TEST MICROSERVICE
- Ready to send a Sendrequest
- Run Catalog.API through profile ‘https’
- it start running at url: https://localhost:5050/
- Send HTTP POST request through Postman
- Lets put bookmarks on Endpoint method “AddRoutes”
- In Visual Studio, If you expand the request, you can see the request values comes in here that we send as a Json payload.
- Convert these request object to the command object. And after that mediator will send the command to the internal handler class.
- Our internal handle class is triggered. And in this code will perform business logic with creating new product and passing and skipping the database operation.
- You can see the result and see the id is newly created product.
f
f