- ABP Framework version: v5.1.4
- UI type: MVC
- DB provider: EF Core
- Module Template: yes
- Steps to reproduce the issue:"
- I've created the module template by using abp suite.
- I've used the Separated Deployment & Databases Scenario. Therefore, I've runned update-db.ps1 script in both HttpApi.Host and IdentityServer projects.
- I've runned the solution.
- I've created the TestUserHandler class under TestApplication.Domain and subscribe the UserEto.
- I've given a reference Volo.Abp.Users.Domain for using UserEto.
public class TestUserHandler : IDistributedEventHandler<EntityCreatedEto<UserEto>>, ITransientDependency
{
private readonly ICurrentTenant _currentTenant;
private readonly ILogger<TestUserHandler> _logger;
public TestUserHandler( ICurrentTenant currentTenant, ILogger<TestUserHandler> logger)
{
_currentTenant = currentTenant;
_logger = logger;
}
public virtual async Task HandleEventAsync(EntityCreatedEto<UserEto> eventData)
{
}
}
- I couldn't subscribe the event while adding a new user.
- When I use the same structure on Single (Unified) Application Scenario, I can subscribe the event and see the data of new user. It is same for EntityUpdatedEto<UserEto>
- Do I need to add external packages or codes for getting the event data or is it a kind of bug? How can I resolve this?
5 Answer(s)
-
0
Did you follow this configuration document?
-
0
Yes, of course. When I configure and map the object which is created by me like document you sent, I can subscribe the event. Like I mentioned, I couldn't subscribe events related with Identity such as creating a new user, creating a new role. Also, I can subscribe these events on Single (Unified) Application Scenario, but not on Separated Deployment & Databases Scenario. I realized above code block, somehow, didn't represent the handler which I created.
-
0
Can you also check the rabbitmq-management page when an event is published to guarantee the event is published?
-
0
I am using the LocalDistributedEventBus which is default.
-
0
I am using the LocalDistributedEventBus which is default.
The user is created at IdentityServer and you are trying to handle it in an Http.Api.Host application. LocalDistributedEventBus works in-process. You need to use a distributed event bus provider like RabbitMq or Kafka.