TagAzure Service Bus

Azure Service Bus Topology migration with NServiceBus

A

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

A

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

A

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

A

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

M

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

M

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

M

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

M

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...

MultiProducerConcurrentConsumer – Push it

M

In the last post, I introduced the start procedure for the MultiProducerConcurrentConsumer including a rough outline of the timer loop responsible for pushing items in batches after the push interval is elapsed. To understand how the batch size affects the push let me first explain the push method. The push method’s responsibility is primarily to insert the item of type TItem into the right slot. To achieve that the passed in slot number is range checked against the available number of...

MultiProducerConcurrentConsumer – Start it

M

In the previous instalment, we discussed the technique of preallocating and reuse to save allocations during runtime. In this post, I will introduce the heart of the MPCC which is the start method and the timer loop outline. The MPCC can get started at any time after construction. If the component is started, it will start pushing items to the pump delegate whenever the batch size is reached or the push interval. This is how the Start method looks like The MPCC can be started once only. There...

Recent Posts