Is there anyone who can help please?
I tried the same things in a new test project, and they worked correctly. Since I created the test project with version 8.2, there were no issues. However, the project I am currently working on has been upgraded from .NET 6. In your opinion, what could I be missing at this point?
Hi, I made a copy-paste mistake. My handler was actually:
public class RecurringJobCreatedOrUpdatedEventHandler : IDistributedEventHandler<RecurringJobCreatedOrUpdatedEto>, ITransientDependency { private readonly ILogger<RecurringJobCreatedOrUpdatedEventHandler> _logger;
public RecurringJobCreatedOrUpdatedEventHandler(ILogger<RecurringJobCreatedOrUpdatedEventHandler> logger)
{
_logger = logger;
}
public Task HandleEventAsync(RecurringJobCreatedOrUpdatedEto eventData)
{
_logger.LogInformation($"Event! JobId: {eventData.JobId}, JobName: {eventData.JobName}");
return Task.CompletedTask;
}
}
So the problem still persists.
Hi, I am trying to trigger an event in my project using DistributedEventBus and RabbitMQ, but I cannot catch the event on the Web side. I would like to explain what I have set up in each layer so you can help me understand if I'm missing something.
My project is MVC and Non-Tiered.
Application.Contracts Layer:
I have created a simple ETO (Event Transfer Object):
[EventName("RecurringJobCreatedOrUpdatedEto")]
public class RecurringJobCreatedOrUpdatedEto
{
public int JobId { get; set; }
public string JobName { get; set; }
}
Application Layer:
In my AppService, I am publishing the event:
private readonly IDistributedEventBus _distributedEventBus;
public RecurringJobsAppServiceBase(IDistributedEventBus distributedEventBus)
{
_distributedEventBus = distributedEventBus;
}
public virtual async Task<RecurringJobDto> UpdateAsync(int id, RecurringJobUpdateDto input)
{
var recurringJob = await _recurringJobManager.UpdateAsync(
id,
input.JobName, input.IsActive, input.CronExpression, input.ConcurrencyStamp
);
var eventData = new RecurringJobCreatedOrUpdatedEto
{
JobId = id,
JobName = input.JobName,
};
await _distributedEventBus.PublishAsync(eventData);
return ObjectMapper.Map<RecurringJob, RecurringJobDto>(recurringJob);
}
I did not make any changes to the ApplicationModule.
Web Layer:
I created a handler for the event:
public class RecurringJobCreatedOrUpdatedEventHandler : IDistributedEventHandler<RecurringJobCreatedOrUpdatedEto>, ITransientDependency
{
private readonly ILogger<RecurringJobCreatedOrUpdatedEventHandler> _logger;
public RecurringJobCreatedOrUpdatedEventHandler(ILogger<RecurringJobCreatedOrUpdatedEventHandler> logger)
{
_logger = logger;
}
public Task HandleEventAsync(RecurringJobCreatedOrUpdatedEto eventData)
{
_logger.LogInformation($"Event! JobId: {eventData.JobId}, JobName: {eventData.JobName}");
return Task.CompletedTask;
}
}
Inside WebModule, I did the following:
Added typeof(AbpEventBusRabbitMqModule) to the dependencies.
In ConfigureServices, I wrote:
context.Services.AddAssemblyOf<RecurringJobCreatedOrUpdatedEventHandler>();
Configure<AbpDistributedEntityEventOptions>(options =>
{
options.AutoEventSelectors.AddAll();
});
appsettings.json Configuration:
"EventBus": {
"UseRabbitMq": true
},
"RabbitMQ": {
"Connections": {
"Default": {
"HostName": "localhost",
"UserName": "myuser",
"Password": "1q2w3E*",
"Port": "5672"
}
},
"EventBus": {
"ClientName": "TEST_Web",
"ExchangeName": "TESTExchange"
}
}
I am sure my rabbitmq is working. when i publish exchange is changing
Problem: The event is successfully published, but the handler in the Web layer is not triggered, and the event is not being caught.
Thank you in advance for your help!
Okey thank you, can you refuse my ticket ?
Hi, I have a personal license, but when I try to run a project, I encounter the following error: 2025-01-17 15:07:52.838 +02:00 [ERR] ABP-LIC-0016 - You are not granted permission to use the module 'Volo.Abp.TextTemplateManagement.Application-v8.2.0.0'. 2025-01-17 15:07:52.838 +02:00 [ERR] ABP-LIC-ERROR - License check failed for 'Volo.Abp.TextTemplateManagement.Application-v8.2.0.0'.
Could you please advise on how I can resolve this issue? Thank you,
I need to customize the PermissionManagement page. I want the elements I've circled to be collapsible under the CRM section. I couldn't find the relevant modal in the source code. How can I make this kind of customization?
Hello, I read this topic We need to ensure that a transaction starts when a Unit of Work (UOW) begins, with strict handling of concurrent user access. For example, in the provided code snippet, when an admin initiates a Unit of Work, other users should be forced to wait until the transaction completes.
using (var uow = _unitOfWorkManager.Begin(requiresNew:true,isTransactional:true, isolationLevel: System.Data.IsolationLevel.ReadUncommitted))
{
try
{
MusteriNumarasiNumarator musteriNumarasiNumarator = await _musteriNumarasiNumaratorManager.CreateAsync();
if( _currentUser.Name == "admin")
{
await Task.Delay(10000);
//throw new UserFriendlyException("hata");
}
var gercekKisi = new GercekKisi(
GuidGenerator.Create()
);
GercekKisi insertGercekKisi = await _gercekKisiRepository.InsertAsync(gercekKisi);
await uow.CompleteAsync();
return insertGercekKisi;
}
catch (Exception)
{
throw;
}
}
The code uses a UnitOfWorkManager to start a transactional Unit of Work with the isolation level set to ReadUncommitted. This setup ensures that the database transaction begins properly. However, we want to implement a mechanism where if the current user is "admin," the system should delay the transaction, potentially causing other users to wait. In the current state, this delay is simulated by a Task.Delay call.
How can we enforce that other users are blocked from accessing this method while the admin’s transaction is still in progress, ensuring that only one user can execute this Unit of Work at a time?
So, if we set this value to a duration like 5-10 seconds, what kind of load would it put on the system?
thanks
we are using LeptonX
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>MyBankStore.Web</RootNamespace>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Common" Version="8.0.4" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.1" />
<PackageReference Include="DistributedLock.Redis" Version="1.0.2" />
<PackageReference Include="System.Private.ServiceModel" Version="4.10.3" /> <PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="8.2.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="8.2.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="8.2.2" />
<PackageReference Include="Volo.Abp.DistributedLocking" Version="8.2.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.Client" Version="8.2.2" />
<PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Http.Client.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="8.2.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.AuditLogging.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Identity.Pro.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Account.Pro.Admin.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Account.Pro.Public.Web.Impersonation" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Account.Pro.Public.Web.Shared" Version="8.2.2" />
<PackageReference Include="Volo.Abp.OpenIddict.Pro.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.LanguageManagement.Web" Version="8.2.2" />
<PackageReference Include="Volo.Saas.Host.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.TextTemplateManagement.Web" Version="8.2.2" />
<PackageReference Include="Volo.Abp.Gdpr.Web" Version="8.2.2" />
<ProjectReference Include="..\BlaBla.HttpApi.Client\BlaBla.HttpApi.Client.csproj" />
<ProjectReference Include="..\BlaBla.HttpApi\BlaBla.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX" Version="3.2.0" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Compile Remove="Pages\Deneme\**" />
<Content Remove="Logs\**" />
<Content Remove="Pages\Deneme\**" />
<EmbeddedResource Remove="Logs\**" />
<EmbeddedResource Remove="Pages\Deneme\**" />
<None Remove="Logs\**" />
<None Remove="Pages\Deneme\**" />
</ItemGroup>
<ItemGroup>
<Content Include="Pages\**\*.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Pages\**\*.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Remove="Themes\LeptonX\Global\side-menu\css\dark.css" />
<None Remove="Themes\LeptonX\Global\side-menu\css\dim.css" />
<None Remove="Themes\LeptonX\Global\side-menu\css\light.css" />
</ItemGroup>
<ItemGroup>
<Content Include="Themes\LeptonX\Global\side-menu\css\dark.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Themes\LeptonX\Global\side-menu\css\dim.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Themes\LeptonX\Global\side-menu\css\light.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>