BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft Introduces Local Emulator for Azure Service Bus Wanted by Developers for Years

Microsoft Introduces Local Emulator for Azure Service Bus Wanted by Developers for Years

In response to developer feedback, Microsoft launched a local Azure Service Bus emulator. According to the company, the emulator promises to simplify the creation and testing of Azure Service Bus applications by offering a localized environment free from network or cloud-related constraints.

The Azure Service Bus is a managed message broker enabling reliable application communication. Its features include queues and topics for efficient handling, load balancing, transactional reliability, and safe data routing for decoupling services.

Despite its robust capabilities, developers often face challenges testing against cloud-based Service Bus instances due to latency, costs, and cloud dependencies. This local emulator addresses these hurdles head-on.

The company designed the emulator with developer convenience in mind, offering several benefits like:

  • Optimized Development Loop: Developers can test and iterate quickly without relying on cloud deployments, drastically reducing the development cycle time.
  • Cost Efficiency: Since the emulator runs locally, it eliminates cloud usage costs for testing and development scenarios.
  • Isolated Environment: Local testing ensures no interference from other cloud-based activities, allowing precise troubleshooting and debugging.
  • Pre-Migration Testing: Developers can trial Azure Service Bus using their existing AMQP-based applications before committing to a full cloud migration.

The emulator is platform-independent and accessible as a Docker image from the Microsoft Artifact Registry. Developers can deploy it quickly using docker compose or automated scripts available in Microsoft’s Installer repository.

While the emulator replicates much of the Azure Service Bus’s functionality, some features are unavailable:

  • Azure-specific integrations like virtual networks, Microsoft Entra ID, and activity logs.
  • Advanced capabilities like autoscaling, geo-disaster recovery, and large message handling.
  • Persisted data: Container restarts reset data and entities.

Furthermore, the emulator is tailored for local development and lacks several high-level Azure Service Bus cloud service features. It does not support a UI portal, visual metrics, or advanced alerting capabilities.

The emulator enforces quotas like the cloud service, such as:

  • Maximum of 50 queues/topics per namespace.
  • Message size capped at 256 KB.
  • Namespace size is limited to 100 MB.

Configuration changes must be pre-defined in config.json and applied before restarting the container.

Developers have long anticipated the local Service Bus emulator for a while. Vincent Kok, a freelance .NET developer, wrote in a post on LinkedIn:

Initially, Microsoft rejected the idea of setting up a local development for Azure Service Bus. The official answer from Microsoft was to use cloud instances of Azure ServiceBus. However, this approach requires each developer to create their own Service Bus namespace to ensure isolated development and testing. Alternatively, developers can share a single Service Bus namespace, but this introduces the risk of messages published by one developer being consumed by another, which is not very practical.

And:

Today, six years after that GitHub issue was first opened, the wait is finally over! Microsoft has released a local emulator for Azure Service Bus, enabling developers to build and test applications locally without needing to spin up cloud instances of Service Bus.

Furthermore, on X, Dave Callan, a Microsoft MVP, tweeted:

It's so amazing that this is finally here.

We can use the emulator to develop and test code against the service in isolation, free from cloud interference.

Lastly, the emulator is compatible with the latest service bus client SDKs.

About the Author

Rate this Article

Adoption
Style

BT