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
- Reviewed the software requirements. See Testing with RabbitMQ.
- 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.
- 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.
- Click Browse to select the physical RabbitMQ transport broker resource that you want to use for recording.
- In the Exchange field, enter the default empty exchange value.
- 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.
- 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.
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
- In HCL OneTest™ API, open the Recording Studio perspective.
- 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.
- 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 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.