How to request to Azure Event Hubs with Apache JMeter™

This tutorial explains how to request to Azure Event Hubs with Apache JMeter™.

Although it may not be common to perform performance testing of Azure Event Hubs by JMeter, we can generate a large number of messages in JMeter to test the sequence of processing in which Azure Event Hubs receives and passes a large number of messages to subsequent components.
In this article, I will show you how to send messages to Azure Event Hubs using the Azure Event Hubs plugin for JMeter that we created.

In this case, it is accessing Azure Event Hubs using AMQP protocol with Shared Access Signature.

Outline of steps

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

Details of steps

  1. Install JMeter plugin for Azure Event Hubs To send AMQP messages to Azure Event Hubs, we will deploy the Azure Event Hubs Sampler plugin of Microsoft Azure plugin for Apache JMeter™.
    1. Get the plugin Get the latest plugins (jmeter-plugins-azure-eventhubs-{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-eventhubs-{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 Event Hubs Sampler
    Add an “Azure Event Hubs Sampler” to the added Thrad Group.
    Add > Sampler > Azure Event Hubs Sampler
    Azure Event Hubs Sampler
    • Event Hubs Namespace: Azure Event Hubs namespace for the messages destination. (e.g. demo-eh.servicebus.windows.net)
    • Event Hub: Event Hub for the messages destination.
    • Partition: Partition to be populated with messages.
      Select “Partition ID”, “Partition Key” or “Not specified” and enter the partition ID or partition key.
    • Auth type: Select “Shared Access Signature” this time.
    • Shared Access Policy: The policy name, as set in the Event Hubs namespace or Event Hub shared access policy.
    • Shared Access Key: Key for the target shared access policy.
    • Event data
      Multiple messages can be sent at once.
      • message type: Type of message to be sent. Select from “String(UTF-8 string)”, “Base64 encoded binary”, or “File”.
      • message: Message to be sent. (If “File” is selected, the file name with full path. ex. /tmp/demo.png)
  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 Event Hubs have received the requests and messages.
    Azure Event Hubs - Overview

The sample jmx file created in this tutorial.

That’s it, this time I’ve introduced the basic method of testing to Azure Event Hubs with Apache JMeter™.

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