Enable Partitions on Azure Service Bus Topics while publishing a message

495 views
Skip to first unread message

PK

unread,
Nov 1, 2016, 4:47:50 PM11/1/16
to masstransit-discuss
I can't seem to find a way to configure the properties of a Topic (specifically to enable partitioning on Topic and to specify the size of a Topic in azure). Here's what I was doing:

            var _busControl = Bus.Factory.CreateUsingAzureServiceBus(sbc =>
            {
                var serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", "AzureSbNamespace", "AzureSbPath");

                var host = sbc.Host(serviceUri, h =>
                {
                    h.TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("AzureSbKeyName", "AzureSbSharedAccessKey", TimeSpan.FromDays(1), TokenScope.Namespace);
                });
            });

           await _busControl.Publish<IModel>(dummyModel);

When the message is published, MassTransit is creating a Topic (if it doesn't exist) based on the type of the message being published. This topic has default settings like 1GB size and partitioning disabled. Is there a way to change these defaults?

We are trying to use this in a deployment script so all the topics are created upfront programmatically. Not sure if anyone uses MassTransit for this. Any help on this is much appreciated.

François

unread,
Jan 4, 2017, 12:42:13 PM1/4/17
to masstransit-discuss
Hi,

I'm also interested in this. I'm using MassTransit at work on top of the Azure Service Bus. We recently had issues with the service bus that were related to the message storage: the SQL Azure DB was experiencing timeouts and longer execution times.

Microsoft's support advised us to use partitioned queues and topics in order to reduce the risk of a global problem. It's straight-forward when you use the Azure Service Bus SDK, as explained in this article: Partitioned queues and topics.

The thing is, I'm relying on MassTransit to automatically create topics, queues and subscriptions. After some digging I figured out a way to enable partitioning on queues when declaring a consumer on a receive endpoint:

configure.ReceiveEndpoint(
    host,
    "event_happened_queue",
    cfg =>
    {
        configure.EnablePartitioning = true;
        cfg.Consumer<EventHappenedConsumer>();
    });

But it doesn't seem to be possible to enable partitioning on topics, when publishing messages using MassTransit. I searched the source code on GitHub for a call to TopicDescription.EnablePartitioning but found nothing.

My questions are:
1. Do you plan to expose a property to enable partitioning on topics?
2. Am I configuring partitioning on queues the right way?

Thank you for your help!


François
Reply all
Reply to author
Forward
0 new messages