Search code examples
javaazurecontinuous-integrationintegration-testingazureservicebus

Azure Service Bus - Integration testing approach for a Java app


What is your approach for integration testing Java applications that use Azure Service Bus for messaging?

I don't want to use the cloud service in every CI build. Would much rather spawn an embedded version of Azure Service Bus or mock it somehow. Alternatively I'm considering coding to AMQP/JMS and using embedded ActiveMQ to emulate Azure Service Bus during CI builds. Thanks.


Solution

  • According to your description, it sounds like you want to use an on-premise compatiable alternative instead of Azure Service Bus to integrate with your Java app for CI on local.

    As I known, there is an alternative named Windows Service Bus before, as the page About Windows Service Bus said as below.

    Windows Service Bus (WSB) can be thought of as an on-premises version of Azure Service Bus.

    But it's offically dead as the SO thread Is Service Bus for Windows Server dead said. And there is no Service Bus emulator like the SO threads Azure Service Bus Emulator and Test Azure Service Bus locally without any subscription or login (be answered by MSFT) said.

    Considering for Azure Service Bus limits and per my experience, I'm not sure there is an alternative software which can instead of it without compatibility issue, so to use the cloud service for CI build is the only choice if you have to.

    If you don't have to use Azure Server Bus for messaging, Azure Storage Queue is a good alternative for integrating with your Java App, and you can refer to the offical document Use the Azure storage emulator for development and testing to download the emulator and use it.