Implementing Dapr Pub/Sub in ASP.NET Core Web APIs

Implementing Dapr Pub/Sub functionality to ASP.NET Core Web APIs

In event-driven architectures, communicating between different microservices via messages can be enabled using Publish and Subscribe functionality (Pub/Sub for short). The publisher (or producer) writes messages to a message topic (or queue), while a subscriber will subscribe to that particular topic and receives the message. Both the publisher and subscriber are unaware of which application either produced or subscribed to the topic. This pattern is useful when we want to send messages to different services, while ensuring that they are decoupled from each other....

August 15, 2023 · 9 min · Will Velida
Using Assertion Scopes to execute multiple Assertions in C#

Using Assertion Scopes to execute multiple Assertions in C#

Fluent Assertions is a .NET library that provides use with a bunch of useful extension methods that allow us to test our C# code in a more natural way. Let’s say for example we are testing the output of a string. Without Fluent Assertions, we might write something like this: string testString = "hello"; string expectedOutput = testString.ToUpper(); Assert.Equal(expectedOutput, "HELLO"); If we were to write this test using Fluent Assertions, we could do so like this:...

June 27, 2023 · 4 min · Will Velida
Building Simple Dapr Cron Jobs with ASP.NET Core Web APIs

Building Simple Dapr Cron Jobs with ASP.NET Core Web APIs

I’ve been thinking about migrating one of my side projects from Azure Functions to the Dapr framework to make it more portable. One of the most important components of this architecture is the ability to refresh an authentication token that enables each Function app to retrieve data from an external API. In an Azure Functions architecture, we can use timer triggers to perform scheduled jobs simply. The issue here is that Functions have an opinionated programming model....

June 19, 2023 · 5 min · Will Velida
Implementing Dapr State Management in ASP.NET Core Web APIs

Implementing Dapr State Management in ASP.NET Core Web APIs

In distributed architectures, we’ll usually have a number of independent stateless services that serve a purpose (set around a domain, such as ordering items, storing items in a catalog, handling authentication etc.) While services should strive to be stateless, there will be some services that need to track state in order to fufil a business operation or function. Dapr has a state management build block that simplifies state tracking and enables you to store state across a variety of data stores....

June 14, 2023 · 12 min · Will Velida
Microsoft Orleans Logo

Building our first Microsoft Orleans App

Continuing my Microsoft Orleans learning journey, I decided to have a bit of a play around with one of their tutorials. When it comes to complex concepts or new frameworks, I like to get my hands dirty with the code to help me understand how the moving parts work together in action. In this blog post, I’ll be building my own version of the minimal Orleans app that tutorial builds and dissecting each part as I go along....

July 10, 2022 · 8 min · Will Velida