Activities of "suresht"

Hi,

Thanks for your suggestion. I was able to fix the issue.

Thanks.

Hi,

I implemented auditing using IAuditingManager. On the Host side, IntegrationServicesTimeCardServiceModule class, the following code has been added:

app.UseAuditing()

On the Module (Services) side, the following code has been added:

Configure<AbpAuditingOptions>(options =>
        {
            options.IsEnabled = true;
            options.IsEnabledForGetRequests = true;
            options.ApplicationName = configuration.GetValue<string>("ApplicationName");
        });

There are no errors when executing the application and testing any endpoint. However, there are no entries in the [AuditLoggingService_dev].[dbo].[AbpAuditLogs] table.

I shared a One Drive link with you so that you can review all code on the Host and Module sides. Please let me know what is incorrect with the implementation and your suggestion on how to fix it.

Thanks.

  • ABP Framework version: v8.3.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:
  • I am unable to find examples that show how to implement a central way of auditing API calls from Module to other systems. I have reviewed details at the following link and am following them:
  • https://abp.io/support/questions/218/AbpAuditLogs-and-AbpAuditLogActions
  • Is there a SQL table that is used for audit logging in abp.io like in abp (AbpAuditLogs table)? If so, is there an example you can provide?
  • Thanks

Hi,

I did more troubleshooting and fixed the issue:

Replaced the following:
context.Services.AddSingleton<AmazonSQSClient>(new AmazonSQSClient());

with:
context.Services.AddSingleton(new AmazonSQSClient(awsRegionEndpoint));

Thanks for your assistance.

  • ABP Framework version: v8.3.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
* An exception was thrown while activating CastandCrew.Payroll.Timecard.CapsPay.v1.CapspaytimecardAppService -> CastandCrew.Payroll.Timecard.Queue.v1.AwsSqsHelper.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating CastandCrew.Payroll.Timecard.CapsPay.v1.CapspaytimecardAppService -> CastandCrew.Payroll.Timecard.Queue.v1.AwsSqsHelper.
 ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'CastandCrew.Payroll.Timecard.Queue.v1.AwsSqsHelper' can be invoked with the available services and parameters:
Cannot resolve parameter 'Amazon.SQS.IAmazonSQS sqsClient' of constructor 'Void .ctor(Amazon.SQS.IAmazonSQS)'.
  • Steps to reproduce the issue:
  • Following is the code in the AbpModule class:
[DependsOn(
    typeof(TimecardDomainModule),
    typeof(TimecardApplicationContractsModule),
    typeof(AbpDddApplicationModule),
    typeof(AbpAutoMapperModule)
    )]
public class TimecardApplicationModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        var configuration = context.Services.GetConfiguration();
        context.Services.AddAutoMapperObjectMapper<TimecardApplicationModule>();
        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<TimecardApplicationModule>(validate: true);
            options.AddProfile<TimecardApplicationAutoMapperProfile>(validate: true);
        });
        //Register an instance as singleton
        context.Services.AddSingleton<AmazonSQSClient>(new AmazonSQSClient());
        //Register a factory method that resolves from IServiceProvider
        context.Services.AddScoped<IAmazonSQS>(
            sp => sp.GetRequiredService<AmazonSQSClient>()
        );
    }
}

Following is the code for AwsSqsHelper class which injects IAmazonSQS:

    public class AwsSqsHelper : ApplicationService, IAwsSqsHelper
    {
        #region Class Variables

        private readonly ILogger<CapspaytimecardAppService> _logger;
        private readonly ISettingProvider _settingProvider;
        private readonly IAmazonSQS _sqsClient;

        #endregion

        #region Constructors

        public AwsSqsHelper(
            IAmazonSQS sqsClient)
        {
            _sqsClient = sqsClient;

            _logger = NullLogger<CapspaytimecardAppService>.Instance;
        }

        #endregion

        #region IAwsSqsHelper Implementation

        public async Task<bool> DeleteMessageAsync(string messageReceiptHandle)
        {
            *** Removed for brevity ***
        }

        public async Task<bool> IsQueueReady()
        {
            *** Removed for brevity ***
        }

        public async Task<List<Message>> ReceiveMessageAsync()
        {
            *** Removed for brevity ***
        }

        public async Task<bool> SendMessageAsync(
            string message,
            SqsMessageAttributes messageAttributes)
        {
            *** Removed for brevity ***
        }

        #endregion
    }

Following is the code for CapspaytimecardAppService:

    public class CapspaytimecardAppService : TimecardAppService, ITimecardAppService
    {
        #region Class Variables

        private readonly IAwsSqsHelper _awsSqsHelper;
        private readonly ICapspaytimecardManager _capsPayManager;
        private readonly ILogger<CapspaytimecardAppService> _logger;
        private readonly IObjectMapper _objectMapper;
        private readonly IStringLocalizer<TimecardResource> _stringLocalizer;

        #endregion

        #region Constructors

        public CapspaytimecardAppService(
            IAwsSqsHelper awsSqsHelper,
            IHttpClientFactory httpClientFactory,
            ICapspaytimecardManager capsPayManager,
            IObjectMapper objectMapper,
            IStringLocalizer<TimecardResource> stringLocalizer) : base(httpClientFactory)
        {
            _awsSqsHelper = awsSqsHelper;
            _capsPayManager = capsPayManager;
            _objectMapper = objectMapper;
            _stringLocalizer = stringLocalizer;

            _logger = NullLogger<CapspaytimecardAppService>.Instance;
        }

        internal CapspaytimecardAppService(
            IAwsSqsHelper awsSqsHelper,
            HttpClient httpClient,
            ICapspaytimecardManager capsPayManager,
            ILogger<CapspaytimecardAppService> logger,
            IObjectMapper objectMapper,
            IStringLocalizer<TimecardResource> stringLocalizer) : base(httpClient)
        {
            _awsSqsHelper = awsSqsHelper;
            _capsPayManager = capsPayManager;
            _logger = logger;
            _objectMapper = objectMapper;
            _stringLocalizer = stringLocalizer;
        }

        #endregion
        
            *** Removed for brevity ***
    }

The code was working until I introduced AmazonSQS implementation. Please let me know if you need additional information.

Thanks.

Hi,

The information from our log which is also stated in the Exception details/Stack Trace portion of the ticket is :

Request reached the end of the middleware pipeline without being handled by application code. Request path: GET http://dev.web-gateway.integrationservices.dev.aws.test.com/api/client/v1/test/contractlocations, Response status code: 404

Eventually, we were able to figure out the issue.

Thanks.

Hi,

Everything works on my side locally as it is on your side. As previously stated, when we deploy to our dev server, then the Client endpoints fail with 404.

Thanks.

Hi,

Do you have an insight into the issue? Do you need any more information than provided?

We would like to resolve the issue as we need to get it deployed soon.

Thanks.

Hi,

The version we are testing has project reference to Client module. Testing locally (localhost), the Client endpoints work.

When deployed and using Nuget packages for Client and Project, the endpoints for Project work. We get the 404 error for Client endpoints.

I have updated the csproj file on the OneDrive location shared with you to include project references to Client module. You will have to update the location to the one appropriate for yours via Abp Studio.

Thanks

Hi,

The microservice (host) has project references to Project Service (module). The screenshot above shows the relative path to the module on my machine based on our repo working folder.

Is it possible for you to change these to the Client and Project module locations on your machine? I use ABP Studio to set/fix the project references:

Please let me know if that works.

Thanks

Showing 1 to 10 of 20 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13