Azure Service Bus Emulator has arrived!

Finally it’s here! Many people (myself included) have waited a very long time for this one. The emulator is provided as a docker image (likely due to the Azure SQL Edge container dependency), Windows, MacOS, and Linux are supported. Both Queues and Topics are supported and configured through a config.json file including complex Azure environment configuration settings. Message streaming with AMPQ, and logging features are included. You can get all the details and install instructions at MSLearn – Azure Service Bus Emulator

Limitations

Partitioning is not supported, nor streaming with JMS protocol or management ops in a client side SDK. the message data is not persistent on restart and a lot of the Cloud scale features / Identity are unsupported, you can find all the limitations here.

One other drawback is you can’t interact/view queues/topics like you would in Azure portal or Service Bus Explorer. I also tested PurpleExplorer with no success.

Limitations aside, this is still a massive gain for local development, especially when developing complex multi-queue/topic interactions in your apps.

Requirements

Docker desktop, WSL (if using Windows)

Setup

There are guides for manual setup in Linux/MacOS or installer scripts for Windows/Linux/MacOS at GitHub – Azure service Bus emulator installer. Also included in that repo is a sample C# .net8 Function app interacting with the emulator.

Alternatives

You could use a local RabbitMQ with MassTransit but that does add a fair bit of code overhead and a config switching for your Azure deployments. At the time of writing, taking RabbitMQ out of the equation and using MassTransit with the emulator has a github issue. My past development experiences have been constrained to using Service Bus in Azure via a connection to ‘dev’ prefixed queues/topics.

Final thoughts

On initial tests, I found the emulator quick and easy to get setup and running with my own function app for adding/consuming queue messages. Regardless of your dev platform you could also setup a VSCode Dev Container docker-compose.yml file to launch the Service Bus emulator with your dev env.

Have you tried it out? Did you find any drawbacks in your local development using this emulator?

Useful Links

MSLearn – Azure Service Bus Emulator

MSLearn – Testing locally with Azure Service Bus emulator

GitHub – Azure Service Bus Emulator Installer

Microsoft Container Registry – servicebus-emulator

VSCode – Dev containers docker-compose

Leave a Reply

Your email address will not be published. Required fields are marked *