Recording MQ telemetry traffic
You can use Test Integrations and APIs 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
- Test Integrations and APIs
- Access to a physical MQ telemetry transport broker and to one or more MQ telemetry transport clients
- In Test Integrations and APIs, create the required physical MQ telemetry transport broker resource. Completing this task enables Test Integrations and APIs to connect to the physical MQ telemetry transport broker that you want to use.
- 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 Test Integrations and APIs
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:
- Click Browse to select the physical MQ telemetry transport broker resource that you want to use for recording.
- In the Topic field, enter the name of the topic that you want to record.
- Optional: In the Client ID field, enter a 23-byte string to identify the operation as a specific MQ telemetry transport client.
- If you want to record many topics, create a logical MQ telemetry
transport connection. Completing this task enables Test Integrations and APIs
to record logical resources.
About this task
In Test Integrations and APIs, 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
- In Test Integrations and APIs, open the Recording Studio perspective.
- 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.
- Start a recording session by clicking Start Recording () on the toolbar of the Events View window.
- Wait for recorded events.
- Stop the recording session by clicking 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 Test Integrations and APIs does not distinguish between publish and subscribe actions in data flows between MQ telemetry transport clients and consumers.
It also means that Test Integrations and APIs 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.