Explains how to create queues with the management client, for more posts in this series go to Contents. Without queues, topics and subscriptions (also called entities) there is not much we can do with an Azure Service Bus namespace. For the start, it is sufficient to create a queue that we will use to send messages to and receive messages from. Creating entities is built into the Azure.Messaging.ServiceBus package and available under the Azure.Messaging.ServiceBus.Administration namespace. A...
Azure Service Bus .NET SDK Deep Dive – Content
In this post series I’m going to dive into the Azure Service Bus .NET SDK and how you can leverage its capabilities to create robust and reliable code that access Azure Service Bus. This series will cover Content Creating queues Sending a message Receiving a message Connections Scheduling Expiry Deadlettering Forwarding Publish / Subscribe with Topics Topologies Atomic Sends Sender side batching Send Via Runtime Information TransferDLQ Sessions Message Deduplication The series of posts...
Azure Service Bus Topology migration with NServiceBus
Azure Service Bus TopologiesAzure Service Bus Topologies with ForwardingAzure Service Bus Topologies of NServiceBusAzure Service Bus Topology migration with NServiceBus (current) In the last post I explained the complexity we introduced for our customers when we created multiple topologies without providing a smooth migration path. In this post I’ll walk you through the online migration path that we created to allow our customers to transition their existing NServiceBus endpoints using...
Azure Service Bus Topologies of NServiceBus
Azure Service Bus TopologiesAzure Service Bus Topologies with ForwardingAzure Service Bus Topologies of NServiceBus (current)Azure Service Bus Topology migration with NServiceBus (next) Almost a decade ago Particular Software started supporting customers running on Azure Service Bus by leveraging a robust and reliable queue abstraction called NServiceBus. Particular Software has been one of the early adopters of the PaaS Service. Hundreds of customers later we can look back at many scars and...
Azure Service Bus Topologies with Forwarding
In the previous blog post, I introduced topologies for Azure Service Bus and how topics and subscriptions can be leveraged to build reliable publish and subscribe infrastructure. All the approaches described in the last post have one major drawback: Subscriptions need to be managed for all events the subscriber wants to subscribe to. Wouldn't it be nice if we could automatically enqueue all messages in the input queue of the subscriber without having to manage receiving infrastructure for all...
Azure Service Bus Topologies
Once you start using Azure Service Bus, you are immediately confronted with queues, topics, subscriptions, and rules. Not only do you have to understand what operational capabilities each of those entities incorporate but you also have to come up with an optimal way of "stitching" them together to create a topology that will satisfy your needs. A good topology allows decoupling senders from receivers and publishers from subscribers by efficiently exchanging messages between clients connected to...
MultiProducerConcurrentConsumer – Completion
In the last post about the MPCC I explained how the asynchronous synchronization works by leveraging the power of a TaskCompletionSource. Today I’ll walk you through the completion method. The completion method has essentially two modes. A drain mode and a non-drain mode. In the drain mode, all items that are enqueued will be asynchronously pushed until all internal queues are empty. In the non-drain mode, the queues will be emptied but nothing will be pushed if there is something left...
MultiProducerConcurrentConsumer – Asynchronous synchronisation
In the last post I explained how the push in batches up to the concurrency per slot works. This post covers the asynchronous synchronisation approach I used to unleash the push in batches when the batch size is reached. In the code shown in the Push It post I simplified the synchronisation primitive and called it syncEvent. In reality, the code uses a TaskCompletionSource for synchronisation. The MPCC declares a field of type TaskCompletionSource<bool>. For the MPCC the TResult type of...
MultiProducerConcurrentConsumer – Push in batches up to concurrency per slot
In the previous post I introduced the PushInBatches method who’s responsibility it is to start the PushInBatchesUpToConcurrencyPerQueueForAGivenSlot process. In this post I will focus on the mouthful method above. Like the name of the method already suggest its responsibility is to push items for a slot in batches to the pump delegate while respecting the concurrency settings per slot as provided by the user and explained in the introduction post. Without further ado here is the whole...
MultiProducerConcurrentConsumer – Push in batches
In the last post, I introduced the push method and the timer loop of the MultiProducerConcurrentConsumer. In this post, I’ll focus on the actual PushInBatches method that gets called by the timer loop. When the method is entered it first checks whether there is anything to push. Since numberOfPushedItems is accessed by multiple threads it uses Interlocked to read it and compare the returned value. When there is nothing to push a completed task is return. By not using the async keyword...