Open Closed

Need assistance for creating Microservices architecture in ABP framewrok #6751


User avatar
0
rishabh.shukla created
  • ABP Framework version: 8.0.3
  • UI Type: Angular
  • Database System: MongoDB
  • Tiered (for MVC) yes or Auth Server Separated (for Angular): yes
  • Steps to reproduce the issue: I need the exact steps to be followed to create a microservices solution in ABP. I have purchased the enterprise license and want to start devlopment on microservices asap.

13 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    please check this documentation https://docs.abp.io/en/commercial/latest/startup-templates/microservice/create-new-microservice

    thanks,

  • User Avatar
    0
    rishabh.shukla created

    I need to use MongoDB with microservices architecture but not able to get it. Used this command :

    abp new Project1 -t microservice-pro -u angular -d mongodb

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Please check this for mongodb https://docs.abp.io/en/commercial/latest/guides/microservice-mongodb

    thanks

  • User Avatar
    0
    rishabh.shukla created

    Also there are few more things that I need help with :

    1. I need to use Azure Cosmos DB , so how do I need Mongo DB drivers to connect to Cosmos DB.
    2. I don't need to have an UI for my project as these will be only microservices. So how do I manage that?
    3. Where do I write down the Dtos, Entities and Interfaces? Inside the services project directly?
    4. Where do I write down the unit test cases for my APIs?
    5. How do I deploy these microservices?

    Thanks in advance.

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    I am trying to give answer per question as below -

    1. please check https://community.abp.io/posts/using-cosmosdb-with-the-abp-framework-via-mongodb-api-x47bjeik

    2. You can use below command in addition while creating project --no-ui: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI).

    3. To write Dtos, Entities and interfaces you can refer tutorials given in documentation https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-1?UI=NG&DB=Mongo from this link follow the backend code development and ignore Ui side development as you want to use no Ui template

    4. For testing part refer https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-4?UI=NG&DB=Mongo

    5. For deployment you can refer https://docs.abp.io/en/abp/latest/Deployment/Distributed-Microservice

      I hope your all questions have answered.

    Thanks

  • User Avatar
    0
    rishabh.shukla created

    For points 3 and 4 we do not have Domain, Application Contracts and Test solutions in Microservice template. So I am not sure whether do I put them?

    Also when creating the project using microservice template , I am getting many errors while opening the project. e.g. Severity Code Description Project File Line Suppression State Error NU1105 Unable to find project information for . If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore.

  • User Avatar
    0
    hitaspdotnet created

    For points 3 and 4 we do not have Domain, Application Contracts and Test solutions in Microservice template. So I am not sure whether do I put them?

    If it's a ABP Studio template ABP Studio's microservice template has single layer services (actually two layers: host and contracts but they named it single layer), it's designed to host modules. you should create your own modules and add their dependencies to the related services: YourModule.Application.Contracts -> YourService.Contracts YourModule.[DB_PROVIDER] & YourModule.HttpApi & YourModule.Application -> YourService YourService.Contracts & YourModule.HttpApi.Client & YourModule.Web -> apps/web

    Also when creating the project using microservice template , I am getting many errors while opening the project.

    you should build your solution via abp studio or run this command in these folders apps/authserver + apps/web + apps/public dotnet build /graphbuild

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello ,

    For points 3 and 4 we do not have Domain, Application Contracts and Test solutions in Microservice template. So I am not sure whether do I put them?

    For this point you can check this link https://docs.abp.io/en/abp/latest/Samples/Microservice-Demo#product-management

    Thank you.

  • User Avatar
    0
    rishabh.shukla created

    I tried to build the solution using dotnet build /graphbuild After that I am running the Administration Service and I am getting error for this after the project runs on browser: Please help me with the same.

    Also, I have few other questions:

    1. How do we remove these by default services and add new ones according to my project? Any specific document for that?
    2. After passing noui as well in the command for project creation, still I get the we apps folder where Web solution is there.

    Please help with the same.

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Have you followed all steps to run the application given here https://docs.abp.io/en/commercial/latest/startup-templates/microservice/get-started

    once check in your DB whether database is created or not?

    otherwise run DBMigrator Application.

    thanks

  • User Avatar
    0
    rishabh.shukla created

    Have run DBMigrator and db schema has been created . But still getting error :

    although RabbitMQ is running and I have updated the same url in appsettings.json

  • User Avatar
    0
    rishabh.shukla created

    My project requirements are:

    1. I need to have 4 to 10 API microservices and no web is required. For web we are having Angular as a separate solution.

    2. We need to use Azure Cosmos DB. As per your document we are not having any mongo connection string provided in the azure. Just primary and secondary keys and connection string for Cosmos DB . We need your help in how do we connect to cosmos in our microservices. Refer to the image below for cosmos db configuration that I have:

    3. We need to use client IDP server for authentication and authorization of API's.

    4. We need to have more information on where and how to implement Unit testing .

    Please help me in creating the solution with only these requirements. I do not need other features like RabbitMQ in my solution.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I need to have 4 to 10 API microservices and no web is required. For web we are having Angular as a separate solution.

    You can create a microservice project with angular UI and remove you don't need some of them

    We need to use Azure Cosmos DB. As per your document we are not having any mongo connection string provided in the azure. Just primary and secondary keys and connection string for Cosmos DB . We need your help in how do we connect to cosmos in our microservices. Refer to the image below for cosmos db configuration that I have:

    Here is the Microsoft document about how to get the Cosmos db connection string: https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/connect-account#get-the-mongodb-connection-string-by-using-the-quick-start

    We need to use client IDP server for authentication and authorization of API's.

    I didn't get it.

    We need to have more information on where and how to implement Unit testing .

    ABP has a lot of examples for unit testing when you create the project, you can see unit test code in the solution

    See also https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-4?UI=NG&DB=EFhttps://docs.abp.io/en/abp/latest/UI/Angular/Testing https://community.abp.io/articles/unit-testing-with-the-angular-ui-p4l550q3

    I do not need other features like RabbitMQ in my solution.

    You can remove RabbitMQ related config from the solution without question.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09