Virtualizing Message Queues

BlazeMeter can mock different protocols within the same Service Virtualization environment; this article shows how to virtualize message queue (MQ) transactions.

If your application under test does not rely on a MQ, use the standard HTTP Runner instead of the Messaging Runner described in this article.

With BlazeMeter Service Virtualization, your application under test does not need to communicate through the live message broker during the test. A virtual service gives you deterministic control over requests and responses and their timings. You attach message recordings to virtual services just as you attach transactions.

BlazeMeter Service Virtualization supports recording IBM WebSphere MQ version 9.x .

This pre-GA (Generally Available) feature is currently accessible to a subset of enterprise customers. If you are an enterprise customer and are interested in accessing this feature before GA, contact support-blazemeter@perforce.com.

 

On this page:

  1. Prerequisites

  2. Create a messaging runner

  3. (Optional) Enable SSL authentication

  4. Assign recordings to the messaging runner

  5. (Optional) Assign transactions to the messaging runner

  6. Run the test

  7. View test analytics

Prerequisites

This procedure assumes you are using the following services in your application under test:

  • a message broker and a MQ

This procedure assumes that you will use the following BlazeMeter features:

  • Set up a Private Location for Service Virtualization

  • Understand the concepts of how BlazeMeter handles Virtual Message Queues

Create a messaging runner

Create a virtual service and configure it as Messaging Runner:

  1. Open the Service Virtualization tab.

  2. Click the Plus button and select Create from Transaction.
    A new virtual service is created.

  3. Define Name, Description, Service, and Endpoint Protocol, as with any virtual service. For more information, see Creating a Virtual Service.

  4. Under Location, select your Private Location that has Service Virtualization enabled.

Configure the Message Runner:

  1. Under Runner, select Messaging Runner to enable messaging support.

    By default, Recording mode is off and the virtual service is now in Playback mode.

  2. Toggle on Runner Active to be able to configure the Runner.

  3. Go to the Broker Configuration tab:

    • On the Basics tab, define the following values to connect to your live message broker for the recoding:

      • Messaging Protocol

      • Hostname - The hostname of the message broker.

      • Port - The port number used by the broker.

      • Channel - The name of the broker channel.

      • Queue Manager - The name of the broker's queue manager.

      • Username - The user ID for broker authentication.

      • Password - The password for broker authentication.

      • Use SSL Authentication - Enable this option if SSL authentication is required.

    • On the Queues tab, click the Plus button to define your queues.

      • Queue Name - Enter the queue name.

    • On the Topics tab, click the Plus button to define your topics.

      • Topic Name - Enter the topic name.

      • Is Durable - Specify true or false.

    • Go to the Flows tab and click the Plus button to configure flows.
      A flow is a reusable configuration that defines how messages are transmitted from a source to its respective destination.

      • Flow Name - Give the flow a name. You will be able to select a flow by name when you add a messaging transaction to the virtual service.

      • Inbound Destination - Enter inbound topics or queues.

      • Outbound Destination - Enter outbound topics or queues.

  4. (Optional) Go to the Transactions tab and assign transactions.

  5. Go to the Recordings tab and assign recordings. If you have no recordings yet, create message recordings now.

  6. (Optional) Configure Data Settings and Runtime Properties, as for any virtual service, if needed. For more information, see Creating a Virtual Service.

  7. Click Update.
    The MQ-enabled virtual service is saved.

You can type in the configuration values, or you reference variables such as ${config.hostname} from your existing service configuration that you have enabled for this virtual service.

(Optional) Enable SSL authentication

To enable SSL authentication for the broker, follow these steps:

  1. Open your messaging-enabled virtual service.

  2. Toggle on Runner Active to be able to configure the Runner.

  3. Go to the Messaging Config tab.

  4. Select Basics and configure SSL:

    • Use SSL Authentication - Enable this option if SSL authentication is required.

    • SSL CipherSuite - The IBM cipher suite name for SSL authentication.
      Use the value from the "Equivalent CipherSuite (IBM JRE)" column of one of the supported cipher suites from TLS CipherSpecs and CipherSuites in IBM MQ classes for JMS.

  5. On the Parameters tab of virtual service, in the SSL settings:

Assign recordings to the messaging runner

Assign recordings to a Messaging Runner similarly to how you assign transactions. For more information on how to create recordings, see Virtualizing Message Recordings.

You can attach both, recordings and transactions, to a virtual service at the same time.

Multiple recordings linked to the same virtual service are played back simultaneously in parallel.

  1. Open the Service Virtualization tab and edit the Messaging virtual service.

  2. Under Runner, toggle on Runner Active to be able to configure the Runner.

  3. Go to Recordings tab under the Runner tab.

  4. Select recordings and click the arrows to assign them to the virtual service.

  5. A dialog prompts you to define the inbound queue/topic and outbound queue/topic.
    Tip: To be able to select your most common inbound-outbound flows quickly, define them as Flow Configurations in the virtual service.

  6. Configure the following parameters for the recording replay:

    • Replay Count - Specifies how many times the recording will be replayed.

    • Delay Between Replays - Specifies the duration of the pause between each replay of the recording, measured in milliseconds.

    • Initial Delay -Specifies the waiting period before the first replay begins, also measured in milliseconds.

(Optional) Assign transactions to the messaging runner

If needed, assign transactions to the Messaging Runner in the same way as how you do it for a HTTP Runner. You can also configure priorities.

In a Message Runner, additionally define inbound and outbound destinations for each assigned transaction; store common pairs of inbound and outbound destinations as reusable Flow Configurations.

Run the test

After you have created recordings and assigned them to the virtual service, BlazeMeter can replay them during a test run without hitting the live message broker. Each recording contains a chain of messages that is replayed deterministically in your defined order.

  1. Open the Service Virtualization tab and edit the Messaging virtual service.

  2. Go to the Runner tab and switch Recording Mode off.

  3. Run the virtual service and copy the endpoint address. For ore information, see Running a Virtual Service.

  4. Configure the application under test to send messages to the virtual service queues instead of live queues, similar to changing endpoints when using HTTP Runner virtual services.

  5. Run your tests.

View test analytics

To view analytics for Message transactions, go to Analytics > Inspection > Messaging Runner > inbound messages.