Open Closed

Issue in web gateway of Microservice templates #2306


User avatar
0
imranStem created

Hi,

I have created a microservices project using the ABP Suite and configured it as per the documentation of the microservice template. When I run the web gateway, I cannot see all the endpoints of administration, identity service, and saas microservices. I checked the source code and compared the microservice template with the older version 4.4.0 and found the following code changes in the WebGateway Module file.

The older version 4.4.0 injected the below modules into the web gateway module.

[DependsOn(
        typeof(CoreSharedHostingGatewaysModule),
        typeof(ProductServiceHttpApiModule),
        typeof(AbpAccountPublicHttpApiModule),
        typeof(IdentityServiceHttpApiModule),
        typeof(SaasServiceHttpApiModule),
        typeof(AdministrationServiceHttpApiModule)
    )]
    public class CoreWebGatewayModule : AbpModule
    {}

In the newer version, 5.0.0 injected the below modules into the web gateway module.

[DependsOn(
        typeof(ChurchPharmacySharedHostingGatewaysModule),
        typeof(ProductServiceHttpApiModule)
    )]
    public class CoreWebGatewayModule : AbpModule
    {}

In the newer version, the administration, identity service, and saas module are not injected. Do we need to inject these three modules into the web gateway to use the endpoints of those modules? the appsettings.json file contains the route configuration of all these modules but endpoints are visible in the Swagger UI.

  • ABP Framework version: 5.0.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

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

    After introducing static proxy for modules in v5.0, web gateways are using static proxies as default. Since they don't use dynamic proxies any more, gateways are no longer dependent on HttpApi layers of microservices. This allows you to easily switch to any other gateway (like envoy etc).

    If you are looking for Swagger UI, gateway adds the swagger definitions of the services it is re-routing. So you can switch between them from the top right corner.

  • User Avatar
    0
    imranStem created

    I looked at the Swagger UI, there is only one definition of web gateway. I also run the angular project and it is throwing below error.

    An error has occurred! Http failure response for https://localhost:44320/api/abp/application-configuration: 0 Unknown Error

    Port 44320 is the web gateway port.

    Can you please provide any documents on a static proxy for modules?

  • User Avatar
    0
    imranStem created

    I got it now. I was running the applications from visual studio IIS express. I run all the projects using 'dotnet run' command and angular projects loading successfully but still, I am not able to see the definitions in Swagger UI. I will check further and will close this issue if everything works fine.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    You can check app.UseSwaggerUI options in OnApplicationInitialization method to see how swagger definitions are created.

    They use ServiceKey of ocelot routes distinctly. They should be selectable on the right top side.

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