diff --git a/src/extensions/azureServiceBus/Wemogy.CQRS.Extensions.AzureServiceBus/Setup/AzureServiceBusSetupEnvironment.cs b/src/extensions/azureServiceBus/Wemogy.CQRS.Extensions.AzureServiceBus/Setup/AzureServiceBusSetupEnvironment.cs
index ff93b8f..1489fcd 100644
--- a/src/extensions/azureServiceBus/Wemogy.CQRS.Extensions.AzureServiceBus/Setup/AzureServiceBusSetupEnvironment.cs
+++ b/src/extensions/azureServiceBus/Wemogy.CQRS.Extensions.AzureServiceBus/Setup/AzureServiceBusSetupEnvironment.cs
@@ -30,17 +30,22 @@ public AzureServiceBusSetupEnvironment(ServiceBusClient serviceBusClient, IServi
/// Creates a ServiceBusProcessor and subscribes to messages of type
///
public AzureServiceBusSetupEnvironment AddDelayedProcessor(
- int maxConcurrentCalls = 1)
+ int maxConcurrentCalls = 1,
+ Action? configureServiceBusProcessorOptions = null)
where TCommand : ICommandBase
{
var queueName = GetQueueName();
_serviceCollection.AddHostedService>(_ =>
{
- var serviceBusProcessor = _serviceBusClient.CreateProcessor(queueName, new ServiceBusProcessorOptions()
+ var serviceBusProcessorOptions = new ServiceBusProcessorOptions()
{
MaxConcurrentCalls = maxConcurrentCalls
- });
+ };
+
+ configureServiceBusProcessorOptions?.Invoke(serviceBusProcessorOptions);
+
+ var serviceBusProcessor = _serviceBusClient.CreateProcessor(queueName, serviceBusProcessorOptions);
var processor = new AzureServiceBusCommandProcessor(serviceBusProcessor, _serviceCollection);
return processor;