When I publish an event and the underlying Azure Service Bus topic does not exists, I do not get any feedback. I’d have expected an exception and I wonder if it’s possible to get any feedback.
Context
- we’re upgrading to
NServiceBus.Transport.AzureServiceBusv5 and start using the new Topic per Event Topology (before that we usedbundle-1) - the topics are deployed to our ASB Namespace through Terraform scripts (not automatically through NSB)
Steps to reproduce
- publish an event (no outbox, transaction, etc. required)
- if the topic exists, this works perfectly fine
- if the topic does not exist, the code runs fine but obviously no event is published – I’d expect an exception or other feedback
var options = new PublishOptions();
options.RequireImmediateDispatch(); // optional
await session.Publish(new SomethingHasHappened(), options);
Analysis/Impact
- in
NServiceBus.Transport.AzureServiceBus.MessageDispatcher.DispatchForDestinationtheServiceBusExceptionis caught (whenMessagingEntityNotFound) and debug-logged/swallowed - I understand that it might be less error-prone if we let NSB automatically create the topics (but I would still not be 100% confident that this works in all scenarios)