Aktivity „rogercprops“

Hi,

I updated the program.cs in the web-gateway and in the HttpApi.Host program.cs in one of the microservices. The log is still showing the ip address of the web-gateway pod.

This is the code in the HttpApi.Host program.cs

\`\*\*using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using CprOnAbp.Shared.Hosting.AspNetCore;
using Serilog;

namespace CprOnAbp.ClientService;

public class Program
{
public async static Task Main(string[] args)
{
var assemblyName = typeof(Program).Assembly.GetName().Name;


    SerilogConfigurationHelper.Configure(assemblyName);

    try
    {
        Log.Information($"Starting {assemblyName}.");
        var builder = WebApplication.CreateBuilder(args);
        
        builder.Services.Configure<ForwardedHeadersOptions>(options =>
        {
            options.ForwardedHeaders =
        ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
        });


        builder.Host
            .AddAppSettingsSecretsJson()
            .UseAutofac()
            .UseSerilog();

        await builder.AddApplicationAsync<ClientServiceHttpApiHostModule>();

        var app = builder.Build();

        app.UseForwardedHeaders();

        await app.InitializeApplicationAsync();
        await app.RunAsync();
        return 0;
    }
    catch (Exception ex)
    {
        Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
        return 1;
    }
    finally
    {
        Log.CloseAndFlush();
    }
}

}
\*\*\`

Hi,

I've provide you read access to the repository.

https://github.com/cpr-ops/web-app

Since this is C# code it's obvious in goes in a .net application. Is that in the front-end application, the ocelot gateway application or the microservice.

If it's in the front end application that won't work for us since we're using Vue for the front-end and using microservices for the backend.

The MVC app is the one that's created with your Microservice Template and we haven't modified it.

The application is running in AKS. I updated the original question with the output from the pod log. The error just repeats infinitely until I delete the application

Could you please be more specific. Maybe I need what and where?

There are multiple topics covered in the link you provided.

Hi,

You're correct that it's an empty service solution because it was created using the ABP CLI for creating a new micro-service

Since Abp Suite doesn't allow adding new microservices to an existing solution, what we usually do is create a duplicate solution using Abp Suite and the Application template so it can automatically generate the code shell for the entity(ies). For example calling it CprOnAbp.StaffService. For EF Core it's a fairly straight forward process to copy the appropriate folders and files from the application template to the micro-service template because Abp Suite generates all of the code in a similar structure as abp new [service name] -t microservice-service-pro --no-ui.

Because the ABP CLI doesn't allow for creation of a microservice using Mongo DB there should be clear instructions on how to change from EF Core to MongoDB.

Also, the guide seems to be based on all services being MongoDB. IMO, this goes against a micro-service architecture principle where the underlying code and database for each service are independent. We should be able to have a mix of EF Core & MongDB services depending on the use case.

Having said all that, following the guide and creating a new Microservice solution and updating the product service I was still not able to find:

  • Volo.Abp.PermissionManagement.EntityFrameworkCore
  • AbpPermissionManagementEntityFrameworkCoreModule
  • IProductServiceDbContext
  • PendingMigrationsCheckerBase

My recommendation for the guide would be to

  • Create a new micro-service in an existing micro-service solution
  • Create a new project for MongoDB and delete the EntityFrameworkCore project. Provide specific code for each file/class in the MongoDB project.
  • Add the steps and code to migrate/seed the data within the service. Would be nice to have the shared dbMigrator do it but not necessary.

For now, I'll do my best to update the service for MongoDB and I'll be happy to share the steps and code if I'm successful.

Hi,

I created a new microservice called StaffService From your guide I could not find the following in my solution:

  • Volo.Abp.PermissionManagement.EntityFrameworkCore
  • AbpPermissionManagementEntityFrameworkCoreModule
  • the Migrations folder
  • IStaffServiceDbContext
  • EfCoreStaffRepository
  • CprOnApbDbMigrationService
  • class DatabaseMigrationEventHandlerBase
  • PendingMigrationsCheckerBase

I get the following errors: StaffServiceEntityFrameworkCoreModule.cs [DependsOn( typeof(AbpMongoDbModule), typeof(StaffServiceDomainModule) )] error: The type or namespace name 'AbpMongoDbModule' could not be found (are you missing a using directive or an assembly reference?)CS0246

context.Services.AddMongoDbContext<StaffServiceDbContext>(options => error: IServiceCollection' does not contain a definition for 'AddMongoDbContext' and no accessible extension method 'AddMongoDbContext' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)CS1061

The 2 biggest issues I have with the support are:

  1. One line answers with no explanation or details. For example: "Add an override to the X method" and then a link to code on GitHub
  2. Similar to item 1, single line responses that are a link to documentation that doesn't answer the question and in most cases we've already read.

Hi @mailiming,

I did review that document earl and as you pointed out, the autosave parameter is not mentioned.

It might be helpful to other to to update the documentation.

Thanks

That fixed it. Thank you.

Is there mention of this in the documentation? If so, can you send a link?

Zobrazených 1 až 10 z 27 záznamov
Made with ❤️ on ABP v8.2.0-preview Updated on marca 25, 2024, 15:11