2
votes

I have a working configuration for a MT setup that is hosted in an Azure Service Fabric solution.

I have an API that sends messages and a stateless app that reads them.

Inside the stateless app I tell it to consume messages of type TestMessage with the following:

container.Register(Classes.FromThisAssembly().BasedOn<IConsumer>());
var busControl = Bus.Factory.CreateUsingAzureServiceBus(cfg =>
        {
            var h = cfg.Host(new Uri("sb://xxxxx.servicebus.windows.net"), host =>
            {
                host.OperationTimeout = TimeSpan.FromSeconds(5);

                host.TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("RootManageSharedAccessKey", "******");
            });

            cfg.ReceiveEndpoint(h, "fabric-test", ec =>
            {
                ec.UseMessageScope<ConsumeContext>();
                ec.LoadFrom(_container);
            });
        });

And in the API I am specifying the fabric-test queue and sending with:

var p = await _bus.GetSendEndpoint(new Uri("sb://xxxxx.servicebus.windows.net/fabric-test"));

await p.Send(new TestMessage(Guid.NewGuid()));

And that all works great - however.

When i look a the azure portal I can see that 3 queues have been created and 1 topic:

  • desktopmmd2jga_stateless1_bus_qypoyyypboqbzhk5bdkg665cyh (queue)
  • desktopmmd2jga_webapi1_bus_qypoyyypboqbsitfbdkg665pdd (queue)
  • fabric-test (queue)
  • xxxxx.core.testmessage (topic)

While it all does work I am wondering what all this is?

1

1 Answers

2
votes

stateless1 is your service fabric bus instance, the temporary queue created for that bus. webapi1 is your web api bus instance, which is used to send to the stateless service, also a temporary queue. fabric-test is your service queue for your receive endpoint. namespace.core.testmessage is your message type, which is subscribed to by your service endpoint.

This is all built by MassTransit, to support the message structure you're using. The temporary queues disappear after 5 minutes, no worries there - they're just for addressing and maintaining the connection to ASB.

The topic is created in the event a message is published of that type, so that your service endpoint receives it. If you don't want to subscribe topics for message types for a particular service endpoint you can specify SubscribeMessageTopics = false in the configuration for that endpoint.`