If you don't want to delete the queue.
You can try:
[Dependency(ReplaceServices = true)]
public class MyRabbitMqMessageConsumer : RabbitMqMessageConsumer
{
public MyRabbitMqMessageConsumer(IConnectionPool connectionPool, AbpAsyncTimer timer, IExceptionNotifier exceptionNotifier) : base(connectionPool, timer, exceptionNotifier)
{
}
protected override Task TryCreateChannelAsync()
{
Queue.Arguments["x-dead-letter-exchange"] = Exchange.ExchangeName+"_dead_letter";;
Queue.Arguments["x-dead-letter-routing-key"] = Queue.QueueName+"_dead_letter";
return base.TryCreateChannelAsync();
}
}
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IRabbitMqMessageConsumerFactory))]
public class MyRabbitMqMessageConsumerFactory : IRabbitMqMessageConsumerFactory, ISingletonDependency, IDisposable
{
protected IServiceScope ServiceScope { get; }
public MyRabbitMqMessageConsumerFactory(IServiceScopeFactory serviceScopeFactory)
{
ServiceScope = serviceScopeFactory.CreateScope();
}
public IRabbitMqMessageConsumer Create(
ExchangeDeclareConfiguration exchange,
QueueDeclareConfiguration queue,
string connectionName = null)
{
var consumer = ServiceScope.ServiceProvider.GetRequiredService<MyRabbitMqMessageConsumer>();
consumer.Initialize(exchange, queue, connectionName);
return consumer;
}
public void Dispose()
{
ServiceScope?.Dispose();
}
}
Hi,
In 4.4 we use dead letter queues for RabbitMQ, But in 5.0 we introduced the inbox outbox pattern, so we no longer use the dead letter queue.
Sorry RabbitMQ does not support update queues, you may need to delete existing queues.
See https://dev.to/ottonova/how-and-why-we-updated-rabbitmq-queues-on-production-2h76
Hi,
Ok, please send the link to my email. shiwei.liang@volosoft.com
Hi
I reproduced the problem.
You are right, ABP will automatically generate Id after entity tracking but EF Core checks for duplicate Ids and throws an exception when tracking entities.
I will try to find a way to solve the problem, for now, you need to generate ids for Children.
Hi,
I will check it.
Hi,
I used the steps you provided, there is no problem. I can't reproduce it.
Can you provide a project to me that can reproduce? shiwei.liang@volosoft.com thanks.
Hi,
You can follow this issue: https://github.com/abpframework/abp/issues/11302
Hi,
It looks like just a warn, did you get some other errors? PS: don't forget to add url
option.