Ends in:
3 DAYS
6 HRS
20 MIN
43 SEC
Ends in:
3 D
6 H
20 M
43 S
Open Closed

Log connection string for each Repository #2976


User avatar
0
lalitChougule created
  • ABP Framework version: v4.3.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no / yes
  • Exception message and stack trace: N.A
  • Steps to reproduce the issue:" N.A

Hi,

Our application is based on micro-service architecture.

In my application I have

  1. Gateway
  2. Identity Server
  3. Service 1
  4. Service 2
  5. Service 3

The solution is not implemented by abp.io Microservice template but it was implemented by your guidance and works as expected. Till now we had only one tenant but still multi tenancy was enabled in our application. Now we want to add few tenants to our system and facing below issues.

Issues :

  1. Migrations and seeding for new Tenant ( Separate database ), Seeding specially for Identity Server Client / Api Resource and all stuff.
  2. Connection string resolution.
  3. Common functionality to trigger migration / update-database for all projects present in application.

Each of the repository is custom repository https://docs.abp.io/en/abp/4.4/Repositories#custom-repository-interface I also tried to implement custom MultitenancyConnectionStringResolver. https://docs.abp.io/en/abp/4.4/Connection-Strings#replace-the-connection-string-resolver

My Questions :

  1. How to implement solution for above mentioned issues.
  2. Currently we created some Tenant database manually by running database script but want to automate this process.
  3. Seeding is also done manually by database script but want to automate this as well.
  4. When we run our application we get error's like Cannot connect to multiple dbContext etc. etc... Clearly connection string is not getting resolved. I need a way where I can log in log.txt file for each repository the connection string via which it is getting connected to the database. And want to make sure that it is connected to the expected database.

Please try to give deep explanation as the whole process is bit complex as we are not having the same template as abp.io microservice template


1 Answer(s)
  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    This seems a custom solution that we can not guide you through. However, we made and keep making lots of improvements to the microservice solution template where we provide solutions for distributed system challenges.

    I can suggest a consultancy request for porting your existing solution to the supported microservice solution template though.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35