-
Hi, I am using ArtemisNetClient.Extensions.DependencyInjection in ASP.NET Core application and I need to call ITopologyManager.DeclareQueueAsync before sending any message (to ensure last-value queue is created). How can I get access to the topology manager using DI or IActiveMqBuilder and where is the best way to call it? thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @pgarbo, To keep things simple I never exposed Then you would need to enable address and/or queue declaration: activeMqBuilder.AddConsumer(address, RoutingType.Multicast, queue, new QueueOptions
{
LastValueKey = "my-key",
NonDestructive = true,
}, MessageHandler)
.EnableAddressDeclaration()
.EnableQueueDeclaration(); In most of the use cases I've seen so far you want to configure address as part of your producer application, and you want to configure queue as part of your consumer application. It your case it clearly doesn't seem to be the case. I guess we could add the option to register custom Please let me know if sth along these lines will work for you. activeMqBuilder.ConfigureTopology(async (_, topologyManager) =>
{
await topologyManager.CreateQueueAsync(new QueueConfiguration
{
Address = addressName,
Name = queueName,
AutoCreateAddress = true
});
}); Thanks, |
Beta Was this translation helpful? Give feedback.
-
Please check 2.11.0. |
Beta Was this translation helpful? Give feedback.
Please check 2.11.0.