Hi, We have recently done a performance and load test on one of our new systems (developed using ABP). The report came out with high recommendation to improve GetApplicationConfiguration application service.
I have notices the TODO comment to optimize and enhance the service in the source code. Also noticed that there are already an implementation for caching the configurations in Volo.Abp.AspNetCore.Mvc.Client
module.
My questions:
CurrentApplicationConfigurationCacheResetEventData
confused me! how can the handler be called if the Volo.Abp.AspNetCore.Mvc.Client
module exists in different application (not the API)? Or I missunderstood the implementation and usage of the module?Fadi Thanks
Still not working! Calling the generated conventional controller does not validae the input. However, after reading the documentation again and again, I figured the issue:
ABP framework uses the dynamic proxying / interception system to perform the validation. In order to make it working, your method should be virtual or your service should be injected and used over an interface (like IMyService).
https://docs.abp.io/en/abp/latest/Validation#validation-infrastructure
Our problem is that the Application Service Method is not virtual, after adding the virtual keyword to the method, it works.
hi
Can you share the full source code to reporduce the problem?
I have reproduced the case with just an empty template and a simple application service bellow:
In Application.Contracts project:
[DependsOn(typeof(AbpFluentValidationModule)]
Added to Module class
//Dto
public class SampleInputDto : EntityDto<Guid>
{
public string RegistrationNumber { get; set; }
}
//Validator
public class SampleInputValidator : AbstractValidator<SampleInputDto>
{
public SampleInputValidator()
{
RuleFor(input => input.RegistrationNumber)
.NotEmpty()
.MaximumLength(25);
}
}
//Application service Interface
public interface ISampleAppService
{
Task AddAsync(SampleInputDto input);
}
In Application project:
public class SampleAppService : AbpFluentValidationDemoAppService, ISampleAppService
{
[Route("add")]
public Task AddAsync(SampleInputDto input)
{
return Task.CompletedTask;
}
}
In HttpApi project (Controllers):
[Route("api/Sample")]
public class SampleController : AbpFluentValidationDemoController, ISampleAppService
{
private readonly ISampleAppService _sampleService;
public SampleController(ISampleAppService sampleService)
{
_sampleService = sampleService;
}
[HttpPost]
[Route("add")]
public Task AddAsync(SampleInputDto input)
{
return _sampleService.AddAsync(input);
}
}
I ended up with two endpoints appear on the Swagger: one for the controller and the other one from the Convension. The problem is that the Fluent Validation is not being called by Conventional Controllers, but working fine for the real controller action.
Should it work? or the fluent validation is not working with Conventional Controllers? Or there is a missing configuration?
Update 21/2/2021: Seems it's not related to Fluent Validation. I have tried to add my custom IObjectValidationContributor and it's called only from Controller and not from Conventional one!
Hi,
If we have many microservices (or systems) and one centeralized Identity server. As I understand, the permission management module is independent from the identity. The question here is: What is the recommended implementation and what are pros and cons of each one:
in option 1, the Identity server have users, roles and clients but not the permission list. In option 2, each client has it's own permission list buut not users, roles and clients! So, how to manage permissions (UI) in each case.
Thanks Fadi