Skip to main content


RabbitMQ–How to remove unacked messages–Part II

Yesterday I showed how to remove unacked messages from a RabbitMQ queue through the Management Portal. Today let us leave the Graphical User Interface behind and solve the same problem from the command line. Through the command line RabbitMQ has multiple command line tools available in the sbin folder. The one we need is rabbitmqctl.bat Show queues with unacked connections like this. rabbitmqctl list_queues name messages_unacknowledged The output should be something like this: VLM.eShopExample.Worker-Development 1 VLM.eShopExample.Worker-Production 0 We see that one queue has an unacked message. Let's find out the channel and associated connection that is causing the unacked message. rabbitmqctl list_channels connection messages_unacknowledged This returns the following output: <rabbit@SERVER.1650192371.27249.9> 1 Ok, we found the channel tha
Recent posts

RabbitMQ–How to remove unacked messages–Part I

I got a situation where a message remained unacknowledged in a RabbitMQ queue. I wanted the related consumer to stop and remove the message from the queue. Let me walk you through the steps to get this done. Through the Management Portal In this post I’ll show you how to this through the Management Portal, in a later post I’ll show you how to do this from the commandline. Open the RabbitMQ Management Portal. Go to the Queues tab. Notice that in one of my queues I have an ‘Unacked’ message. First we need to find the connection that is related to the application consuming the message. Therefore go to the Connections tab. Click on the correct connection. Expand the Close this connection section and hit the Force Close button to close the connection and related channels. Click OK when asked for confirmation. Now go back to the Queues tab. Click on the queue with the ‘Unacked’ message. Expand the Purge section and hit the Purge Messages button.

Change the default Outlook meeting length

An unfortunate consequence of COVID-19 is that I had a lot more meetings online. Because those meetings are planned remotely it became easy to plan them back-to-back as we no longer had to take into account that people have to physically move from one meeting room to another. This made it really difficult to regain time to think, to recharge the batteries and keep focussed. In the end it became a real energy drain and had a negative impact on my productivity. To help myself (and my team) to create some time between our meetings, I changed the default meeting length in Outlook. Open Outlook. Go to File –> Options . In the Options window, go to Calendar . In the Calendar Options section, put a check in the Shorten appointments and meetings checkbox. If you want you can change the time a meeting should be shortened.  

Generate C# code from a JSON schema - Part II

Yesterday I shared how to create your C# data contracts from an available JSON schema. In that post I demonstrated Quicktype as a way to generate those contracts. There was only one disadvantage when using Quicktype; it only supports Newtonsoft.Json . Today I want to have a look at an alternative that does have support for System.Text.Json. Introducing NJsonSchema After looking around on Github I found NJsonSchema for .NET : NJsonSchema is a .NET library to read, generate and validate JSON Schema draft v4+ schemas. The library can read a schema from a file or string and validate JSON data against it. A schema can also be generated from an existing .NET class. With the code generation APIs you can generate C# and TypeScript classes or interfaces from a schema. It offers multiple features: Read existing JSON Schemas and validate JSON data Generate JSON Schema from an existing .NET type Generate JSON Schema from sample JSON data Generate C# and TypeScript cod

Generate C# code from a JSON schema - Part I

I’m having fun creating a small open-source project(more about that later). In a part of this project I need to integrate with an existing API. I first started by browsing through the API documentation and use that to build my data contract classes in C# until I discovered that a JSON schema document was provided. In this post I want to show you can use this JSON schema document to generate the C# classes instead of writing them from scratch JSON schema Before I show you how to generate the C# code, I want to take a small detour and give you some more details about JSON schema itself. Let’s have a look how it is explained on the website itself: JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. If you have ever used SOAP services in a previous life, JSON Schema can be compared to the WSDL documentation that was available there. It gives you an concise and easy way to describe your data format, provides you all the meta

Using secrets in your unit tests

I'm having fun creating a small open-source project(more about that later). In a part of this project I need to integrate with an existing API. Of course I want to have the necessary integration tests that help me verify if the integration with this API works correctly. There is only one problem, I need to pass an API key to call this API. How can I safely use and store this API key in my tests without checking the key in as part of my source code? ASP.NET Core Secret Manager In your ASP.NET Core application self you can use the Secret Manager Tool. This tool allows you to store your secrets in a separate location from the project tree. This guarantees that the app secrets aren’t checked into source control. The Secret Manager tool hides implementation details, such as where and how the values are stored. The values are stored in a JSON file in the local machine's user profile folder. For example on Windows: %APPDATA%\Microsoft\UserSecrets\<user_secrets_id>\secret

The paved road

As an architect, I want to give my teams as much freedom as possible and trust them to take responsibility. Of course this should be balanced with the business and architectural goals. So how can you achieve this? Let me explain on how I like to tackle this... The paved road The way I use to lead my teams in the right direction is through a ‘paved road’. This means I’ll provide them a default stack that is easy to use with a lot of benefits, tools, documentation, support, … that help them during there day-to-day job. They can still go offroad if they want to, but I found out it is a good way to create alignment as much as possible without the teams losing their autonomy. It is also a good way to avoid the ‘ivory tower architecture’ and it leaves space for experimentation and improvements. Some things I typically provide as part of the paved road: A default application architecture: a template solution, starter kit or code generator that helps you to setup a default