Hi,
Can you try cal the await UnitOfWorkManager.Current.SaveChangesAsync();
after await _storesAppService.CreateAsync(newStore);
.
// Change Tenant
using (CurrentTenant.Change(existingTenant.Id))
{
// Create New Store
var newStore = new StoreCreateDto
{
ExternalId = storeName,
Name = storeName,
Timezone = ecomStore.Timezone
};
await _storesAppService.CreateAsync(newStore);
await UnitOfWorkManager.Current.SaveChangesAsync();
}
Hi,
You can custom the events model.
See: https://documentation.openiddict.com/guides/index.html#events-model, https://github.com/openiddict/openiddict-core/issues/1477#issuecomment-1166658609
Can you remove PublishTrimmed
or set it to false.
Hi,
Can you share the full steps or a project that can reproduce the problem with me? shiwei.liang@volosoft.com thanks
Hi,
It's a problem, https://github.com/abpframework/abp/issues/14021. we will fix it. BTW, your ticket refuned.
For now, you can try:
[Dependency(TryRegister = true)]
[ExposeServices(typeof(ILocalEventBus), typeof(LocalEventBus))]
public class MyLocalEventBus : LocalEventBus, ISingletonDependency
{
public MyLocalEventBus(
IOptions<AbpLocalEventBusOptions> options,
IServiceScopeFactory serviceScopeFactory,
ICurrentTenant currentTenant,
IUnitOfWorkManager unitOfWorkManager, IEventHandlerInvoker eventHandlerInvoker) : base(options, serviceScopeFactory, currentTenant, unitOfWorkManager, eventHandlerInvoker)
{
}
protected override Guid? GetEventDataTenantId(object eventData)
{
var tenantId = base.GetEventDataTenantId(eventData);
if (tenantId.HasValue)
{
return tenantId;
}
if (eventData is EntityUpdatedEto<UserEto> data)
{
return data.Entity.TenantId;
}
return null;
}
}
context.Services.AddSingleton<ILocalEventBus, MyLocalEventBus>();
Hi,
I agree with what mookid8000 said, If rebus can't connect to RabbitMQ, it's better to throw an exception to let the application stop, in this way you can quickly find the problem and fix it.
But However, you can do it:
Open your module class:
public override void OnPreApplicationInitialization(ApplicationInitializationContext context)
{
Policy.Handle<Exception>().WaitAndRetry(5, retryCount => TimeSpan.FromSeconds(retryCount))
.Execute(() =>
{
context.ServiceProvider.UseRebus();
});
}
Hi,
I will check it out.
Hi, @ademaygun
You can just use the ABP's BackgroundJob system instead of Hangfire, it can work with the ABP Unitofwork system.
Hi,
Could you share the steps to reproduce or a project that can reproduce the problem with me via email? shiwei.liang@volosoft.com thanks.