Recording MQ telemetry traffic

You can use HCL OneTest API to record MQ telemetry transport traffic by connecting to the MQ telemetry transport broker that you want to use and subscribing directly to topics communicated from that broker.

Before you begin

Software requirements:
  • HCL OneTest API
  • Access to a physical MQ telemetry transport broker and to one or more MQ telemetry transport clients
Complete the following tasks:
  1. In HCL OneTest API, create the required physical MQ telemetry transport broker resource. Completing this task enables HCL OneTest API to connect to the physical MQ telemetry transport broker that you want to use.
  2. Determine the number of topics that you want to record:
    • If you want to record many topics, create a logical MQ telemetry transport connection. Completing this task enables HCL OneTest API to record logical resources.
      Note: In the Recording tab of the MQTT Connection window, you have the option to specify the topics that are to be matched when recording.
    • Alternatively, if you want to record only one topic, you can create an operation to specify the topic to which the data is published. In the Message Exchange Pattern tab in the Operation window, complete the following tasks:
      1. Click Browse to select the physical MQ telemetry transport broker resource that you want to use for recording.
      2. In the Topic field, enter the name of the topic that you want to record.
      3. Optional: In the Client ID field, enter a 23-byte string to identify the operation as a specific MQ telemetry transport client.

About this task

In HCL OneTest API, MQ telemetry transport traffic is recorded by connecting to the MQ telemetry transport broker that you want to use and subscribing directly to topics communicated from that broker.

You can create tests and stubs from any events captured in the Recording Studio perspective.

Procedure

  1. In HCL OneTest API, open the Recording Studio perspective.
  2. Create an event monitor for recording traffic from the MQ telemetry transport broker:
    In the Select a Resource window:
    • Select a logical MQ telemetry transport connection if you want to record multiple topics.
    • Alternatively, select an operation if you want to record only a single topic.
  3. Start a recording session by clicking Start Recording (Start Recording) on the toolbar of the Events View window.
  4. Wait for recorded events.
  5. Stop the recording session by clicking Pause recording (Pause recording) on the toolbar of the Events View window.

Results

All events captured are displayed in the Events View of Recording Studio as publish actions in Byte Array message format.

This means that HCL OneTest API does not distinguish between publish and subscribe actions in data flows between MQ telemetry transport clients and consumers.

It also means that HCL OneTest API does not take into account the direction of messages between physical MQ telemetry transport brokers and MQ telemetry transport client applications.

You can use the Recorded Events wizard to save the recorded events as a test, stub, or other project resource.