Although it may not be common to perform performance testing of Azure Service Bus by JMeter, we can generate a large number of messages in JMeter to test the sequence of processing in which Azure Service Bus receives and passes a large number of messages to subsequent components.

In this article, I will show you how to send messages to Azure Service Bus using the Azure Service Bus plugin for JMeter that we created.

In this case, it is accessing Azure Service Bus using AMQP protocol with shared access signature.

Outline of steps

  1. Install JMeter plugin for Azure Service Bus
  2. Add a Thread Group
  3. Add an Azure Service Bus Sampler
  4. Add listeners to see the results of the execution
  5. Run the test

Details of steps

  1. Install JMeter plugin for Azure Service Bus
    To send AMQP messages to Azure Service Bus, we will deploy the Azure Service Bus Sampler plugin of Microsoft Azure plugin for Apache JMeter™.
    1. Get the plugin
      Get the latest plugins (jmeter-plugins-azure-servicebus-{version}.jar) from the following page using a web browser.
      https://github.com/pnopjp/jmeter-plugins/releases

    2. Copy the downloaded jar file to $JMETER_HOME/lib/ext

      $ cp jmeter-plugins-azure-servicebus-{version}.jar /usr/local/jmeter/lib/ext
      
    3. Start or restart JMeter

  2. Add a Thread Group
    Add a "Thread Group" to the Test Plan.
    Add > Threads (Users) > Thread Group
  3. Add an Azure Service Bus Sampler
    Add an "Azure Service Bus Sampler" to the added Thrad Group.
    Add > Sampler > Azure Service Bus Sampler
    Azure Service Bus Sampler
    • Connection/Transaction: Select "Create New Connection" at this time.
    • Service Bus Namespace: Azure Service Bus namespace for the messages destination. (e.g. demo-sbq.servicebus.windows.net)
    • Send messages to: Select whether to send messages to the Queue or Topic.
    • Queue Name / Topic Name: Queue or Topic name for the messages destination.
    • Protocol: Select a protocol from "AMQP" or "AMQP over Web Sockets".
    • Auth type: Select "Shared access signature"at this time.
    • Shared Access Policy: The policy name, as set in the Service Bus namespace or Service Bus shared access policy.
    • Shared Access Key: Key for the target shared access policy.
    • Create transaction before sending messages: "OFF" at this time.
    • Messages
      Multiple messages can be sent at once.
      • message type: Select "String" at this time.
      • message: Message to be sent. (e.g. "Hello, Azure Service Bus!)
      • message Id, session Id, partition key: Parameters to be specified in the message. Not specified at this time.
  4. Add listeners to see the results of the execution
    Add a "View Results Tree" listener to the Test Plan or thread group.
    Add > Listener > View Results Tree
  5. Run the test
    Run > Start to run the test and select the resulting "HTTP Request".
    Check the Azure Portal to make sure that the corresponding Service Bus have received the requests and messages.
    Azure Service Bus - Overview

The sample jmx file is here.

That's it, this time I've introduced the basic method of testing to Azure Service Bus by Apache JMeter™.

[ad]
Easily build a JMeter distributed test environment in Microsoft Azure by Load Tester Powered by Apache JMeter™