Recording RabbitMQ transport traffic

The RabbitMQ proxy recording feature (this is not HTTP based) enables HCL OneTest API to record RabbitMQ transport traffic that is routed through the proxy.

Before you begin

Ensure that you have completed the following tasks:
  1. Reviewed the software requirements. See Testing with RabbitMQ.
  2. In HCL OneTest API, you must have created the required physical RabbitMQ transport broker resource. This action enables HCL OneTest API to connect to the physical RabbitMQ transport broker that you want to use.
  3. You must have determined the number of queues that you want to record:
    • Ensure that you have created logical RabbitMQ transport connections for the queues you want to record. Completing this task enables HCL OneTest API to record logical resources.
      Note: In the Recording tab, you have the option to specify the queue that is to be recorded.
    • Alternatively, an operation can be created to specify the queue upon which the data will be published if you want to record using the operation rather than the transport. You can set the operation by using the Message Exchange Pattern tab in the Operation window.
      1. Click Browse to select the physical RabbitMQ transport broker resource that you want to use for recording.
      2. In the Exchange field, enter the default empty exchange value.
      3. In the Routing Key field, enter the base name of the queue that you want to record. The suffix from the transport will then be applied as required to this base name.

About this task

In HCL OneTest API, RabbitMQ transport traffic is recorded by connecting to the RabbitMQ transport broker that you want to use and by monitoring the proxy queue configured.

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 RabbitMQ transport broker from the Select a Resource window by selecting a logical RabbitMQ transport connection if you want to record topics.
  3. Start a recording session by clicking Start Recording (image of the icon) on the toolbar of the Events View window.
  4. Wait for recorded events.
  5. Stop the recording session by clicking Pause recording (image of the icon to 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 or reply/request actions in Byte Array or text format as expressed by the content type.

HCL OneTest API considers the direction of the messages, because of the use of the reply-to message header that allows the proxy recording to distinguish between publish and request/reply against the recorded queue.

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