RoundRobin ASB Strategy Behavior?

Hi,

My application manage too much messages on only one instance of AzureServiceBus. This instance is always satured (4 K messages / minutes for exemple).

I decide to use “RoundRobinNamespacePartitioning” strategy with two instances of AzureServiceBus.

But I note with this strategy, there is only the first NameSpace witch have activity (commands and events received and sended). The second NameSpace have zero activity.

Is a normal behavior ?

Thanks

Best Regards

@bobytch,

RoundRobinNamespacePartitioning strategy should randomly select a namespace to use for sending.

Could you please share your configuration code and how you determine the second namespace is not being used? Thank you.

Hi Sean,

Thank you for taking some time to answer me.
Below you will find the full configuration of one of my endpoint which is hosted in a worker role. All of our worker role have a similar configuration.
This is not entirely true that there is no activity on the second namespace, but there is no message that passes through it, never. There are queries (I guess to try to retrieve messages) but no message. It is the azure portal that shows me (See the pictures below). I also use mutators to check it.

Here the queries and message of the first namespace and on the secondnamesapce

Here my configuration

public void Customize(EndpointConfiguration endpointConfiguration)
{
endpointConfiguration.UseSerialization<NewtonsoftSerializer>();

[details=Persistence]

#region Persistence
//Saga
var persistenceSaga = endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Sagas>();
persistenceSaga.ConnectionString(CloudConfigurationManager.GetSetting(“NServiceBusPersistenceConnectionString”));
persistenceSaga.CreateSchema(true);
// Added in Version 1.4
persistenceSaga.AssumeSecondaryIndicesExist();

//Subscriptions
var persistenceSubs = endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Subscriptions>();
persistenceSubs.ConnectionString(CloudConfigurationManager.GetSetting(“NServiceBusPersistenceConnectionString”));
persistenceSubs.TableName(“MySubscriptions”);
persistenceSubs.CreateSchema(true);
// Added in Version 1.3
persistenceSubs.CacheFor(TimeSpan.FromMinutes(1));

//Timeouts
var persistenceTimeouts = endpointConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Timeouts>();
persistenceTimeouts.ConnectionString(CloudConfigurationManager.GetSetting(“NServiceBusPersistenceConnectionString”));
persistenceTimeouts.CreateSchema(true);
persistenceTimeouts.TimeoutManagerDataTableName(“TimeoutManager”);
persistenceTimeouts.TimeoutDataTableName(“TimeoutData”);
persistenceTimeouts.CatchUpInterval(3600);
persistenceTimeouts.PartitionKeyScope(“yyyy-MM-dd-HH”);
#endregion
[/details]
#region Transport
var transport = endpointConfiguration.UseTransport();
transport.BrokeredMessageBodyType(SupportedBrokeredMessageBodyTypes.Stream);

var partitioning = transport.NamespacePartitioning();
partitioning.UseStrategy();
partitioning.AddNamespace(
name: “namespace1”,
connectionString: CloudConfigurationManager.GetSetting(“NServiceBusTransportSB1ConnectionString”));
partitioning.AddNamespace(
name: “namespace2”,
connectionString: CloudConfigurationManager.GetSetting(“NServiceBusTransportSB2ConnectionString”));

endpointConfiguration.LimitMessageProcessingConcurrencyTo(Convert.ToInt32(CloudConfigurationManager.GetSetting(“MaximumConcurrencyLevel”)));

transport.Queues().LockDuration(TimeSpan.FromMinutes(5));
transport.Queues().MaxDeliveryCount(5);
#endregion

[details=Sanitization]
#region Sanitization homemade
var sanitization = transport.Sanitization();
sanitization.UseStrategy();
#endregion[/details]

[details=Topology]
#region Topology
transport.UseForwardingTopology();
#endregion[/details]

[details=Registration+Autofac]> #region Registration B2FDbContext + Autofac
var builder = new ContainerBuilder();

endpointConfiguration.RegisterComponents(
registration: configureComponents =>
{
configureComponents.ConfigureComponent(DependencyLifecycle.InstancePerCall);
});

var Container = builder.Build();

endpointConfiguration.UseContainer(
customizations: customizations =>
{
customizations.ExistingLifetimeScope(Container);
});
#endregion[/details]

[details=Audit/Error]
#region Audit/Error
endpointConfiguration.SendFailedMessagesTo(“error”);
endpointConfiguration.DisableFeature();
#endregion[/details]
}

Versions I use:
NServiceBus 6.4.2
NServiceBus.Autofac 6.0.1
NServiceBus.Azure.Transports.WindowsAzureServiceBus 7.2.9
NServiceBus.Hosting.Azure 7.1.3
NServiceBus.Newtonsoft.Json 1.1.0
NServiceBus.Persistence.AzureStorage 1.4.0
.Net Framework 4.5.2

Thanks

I raised an issue for this

I think caching is getting in the way

Hi Yves,

Thanks for your feedback.
Do you know if there is a workaround solution ?

Thanks

Hi Vincent,

There’s not woraround as it’s something on the transport level.
We’ll be working on a patch. Please follow the issue Yves has opened.

Thank you,
Sean

Hi Vincent,

For version 7 of the transport I have opened a dedicated issue to cover the patch we’ll release.
Please follow this GitHub issue https://github.com/Particular/NServiceBus.AzureServiceBus/issues/673.

Thank you,
Sean

Hi Sean,

Thanks you.

Vincent

Vincent,

A patch was released today that included a fix for this specific issue. Please see details at this link.

Sean