Mike Hadlow

C# .NET Developer

  • Large Numbers of Bindings With RabbitMQ
    Aug 19, 2021

    RabbitMQ (or more specifically the AMQP protocol) provides a degree of flexibility over other message-queue solutions with its exchange-binding-queue model. Some possible solutions to scaling or business issues result in large numbers of bindings being created, perhaps thousands per queue. We tested RabbitMQ to find out what the binding performance limits were and present the results in this post. It seems that large numbers of bindings are not in themselves a performance issue, but on a RabbitMQ cluster, “binding churn” the rate at which they are created and destroyed can have a large impact on message delivery and because bindings can take time to propagate through the cluster there is the possibility of message loss.

    Read more...


  • Register a Microsoft.Extensions.Logging.ILoggerProvider with EasyNetQ
    Aug 13, 2021

    EasyNetQ is an opinionated fully featured client API for RabbitMQ. It provides extensive diagnostic logging capabilities via LibLog a logging abstraction that provides support for many common logging libraries. Unfortuntely LigLog doesn’t support Microsoft.Extensions.Logging, but this post provides an adaptor, EasyNetQMicrosoftExtensionsLogProvider that will allow EasyNetQ to log to a Microsoft.Extensions.Logging.ILoggerProvider.

    Read more...


  • How to create a standalone ConsoleLoggerProvider
    Jul 27, 2021

    If, for whatever reason you want to create a stand alone instance of ConsoleLoggerProvider without having to leverage dependency injection and the full Hosting framework, you’ll find that the ConsoleLoggerProvider’s constructor requires an instance of an IOptionsMonitor<T>, the only instance of which OptionsMonitor<T> in turn has a complex constructor with many dependencies. This all seems like a failure of design on Microsoft’s part. Here I give a simple no-op IOptionsMonitor<T> implementation to allow one to easily create a ConsoleLoggerProvider.

    Read more...


  • Microsoft.Extensions.DependencyInjection object graph writer
    Jul 20, 2021

    It’s very useful sometimes to be able to quickly view the object graph created by a dependency injection (or IoC) container, especially when you’re a new starter on an existing project. I was recently attempting to get up to speed on a .NET Core project, but I couldn’t find anything that would output an object graph from the Microsoft.Extensions.DependencyInjection IServiceCollection, so I wrote a simple class that reads the graph and outputs a basic representation. I’m sharing it here for my own benefit, but also as a starting point if anyone else needs something similar.

    Read more...


  • A Simple Console Periodic Loop in C#
    Jul 9, 2021

    I found myself writing the same code several times for a simple console periodic loop, so I’m posting the framework here mainly for my own benefit. This uses C# 7’s new async Main entry point and avoids the need to spawn a new thread for the loop. Worth noting though that each iteration after the Task.Delay will run on a threadpool thread.

    Read more...


  • Welcome To My New Blog
    Jul 6, 2021

    I’ve been blogging since 2005 and have written hundreds of posts in that time, but my blogging output has declined somewhat over the last few years. That’s partly laziness on my part, and partly because Twitter provides a much more convenient platform for the quick take, but it’s also because there’s too much friction in publishing a post on my long running Google Blogger site Code Rant. Google has done little to update the ancient Blogspot platform over the years and it’s showing its age. The effort required to upload and format a blog post is too high, and has effectively disincentivised me from blogging. In the last few years I’ve sometimes managed just a single post per year. So, long overdue, I’ve decided to start a new blog here at mikehadlow.com using modern developer platform technologies. This is the first post.

    Read more...


Hi, I’m Mike Hadlow. Software developer, architect, blogger and open source developer.

Find my old blog at Code Rant. This ran from 2005 to 2020 and has hundreds of posts.

All code on this blog is published under an MIT licence. You are free to copy it and use it for any purpose without attribution. There is no warranty whatsoever.

There are no cookies on this site

The GitHub repository for this site is here.