[Service Bus] Rework MessageLockCancellationToken/SessionLockCancellationToken to use events
See original GitHub issueAfter reviewing the proposed API with the architects, we received feedback that it would be more idiomatic to have a pattern like the following:
async Task ProcessMessage(ProcessMessageEventArgs args)
{
using var cts = CancellationTokenSource.CreateLinkedTokenSource(args.CancellationToken);
args.MessageLockLostAsync += cts.Cancel();
await FooAsync(args.Message, cts.Token);
}
This means we would need to replace the MessageLockCancellationToken/SessionLockCancellationToken properties with events that can be subscribed to.
/cc @danielmarbach
Issue Analytics
- State:
- Created 2 months ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Service Bus queues and topics as event handlers for Azure ...
Describes how you can use Service Bus queues and topics as event handlers for Azure Event Grid events.
Read more >Azure Service Bus to Event Grid integration overview
This article provides a description of how Azure Service Bus messaging integrates with Azure Event Grid.
Read more >One topic per event producer VS One topic shared across ...
UPDATE 1: I don't know NServiceBus, but I've worked a bit with MassTransit and when leveraging the topology creation to MassTransit (which is ......
Read more >Posting Microsoft Dataverse Events to Azure Service Bus
There will be situations where you may need to export core, transactional information from Microsoft Dataverse into an external system.
Read more >How to Chose | Azure Service Bus vs Event Hub vs ... - YouTube
We also compare Azure Service Bus, Azure Event Grid, and Azure Event Hub to ... Azure Event Hub 3️⃣ Exploration of their real-time...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks. I’m currently on vacation and taking a bit of a break from coding. I’m back in two weeks and could pick it up if it hasn’t been done until then but I guess you want to fix this asap
Another benefit of the event-based approach is that we can subclass EventArgs to allow us to flow through context data to the event. It is probably interesting to include the exception, and possibly the LockedUntilTime.