Azure Scheduler
Azure Service Bus timestamps allows scheduling messages for future delivery. In V10, we added support for Azure Service Bus Scheduler to Brighter's scheduling functionality.
Usage
To use Azure Service Bus timestamp with Brighter:
Create a subscription for the
FireAzureScheduleconsumer.Install the
Paramore.Brighter.MessageScheduler.Azurepackage.
Example Configuration
private static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
ConfigureBrighter(hostContext, services);
});
private static void ConfigureBrighter(HostBuilderContext hostContext, IServiceCollection services)
{
services
.AddServiceActivator(options =>
{
options.Subscriptions = new[]
{
// Subscription for FireAzureSchedule
new AzureServiceBusSubscription<FireAzureSchedule>(
new SubscriptionName("paramore.example.scheduler-message"),
new ChannelName("message-scheduler-channel"),
new RoutingKey("message-scheduler-topic"),
bufferSize: 10,
timeOut: TimeSpan.FromMilliseconds(20),
lockTimeout: 30 // Fixed typo from 'lockTime out' to 'lockTimeout'
)
};
})
.UseScheduler(new AzureServiceBusSchedulerFactory(
new ServiceBusVisualStudioCredentialClientProvider(),
"some-role"
));
}Important Considerations
Rescheduling Limitations
Azure Service Bus does not support modifying the EnqueuedTimeUtc property of scheduled messages. To reschedule a message:
Cancel the existing scheduled message
Create a new scheduled message with updated timing
Key Components
Service Bus Credentials Uses
ServiceBusVisualStudioCredentialClientProviderfor authentication (requires proper Azure AD configuration).Message Handling Ensure your
FireAzureScheduleconsumer is properly configured to handle scheduled messages.
Last updated
Was this helpful?
