AMQP Receive

Applies to ReadyAPI 3.51, last modified on March 21, 2024

About AMQP Receive test step

Use this test step to simulate actions of an AMQP consumer. The test step connects to an AMQP broker and fetches a message from a queue.

Note: To use the test step, you must have the AMQP Support Plugin installed. You can install it on the Integrations tab.

Requirements

To use this test step, you need a ReadyAPI Test license. If you do not have it, you can request it on our web site or start a trial.

Editing AMQP Receive test step

You can modify the setting of the test step in its editor:

AMQP Testing: Receiving a message

Click the image to enlarge it.

Connection

Choose a configured connection to the broker from the drop-down list, or select [Create new connection] to create a new connection using the Create AMQP Connection dialog. Click the Edit button to customize properties of the selected connection in the Edit AMQP Connection dialog.

Queue

The name of the queue from which a message will be fetched.

Note: This field supports property expansions.

Acknowledge

If the option is checked, ReadyAPI informs the broker that the message has been received.

Timeout (ms)

The period, in milliseconds, during which ReadyAPI expects to receive a message from the queue. If no message is received after the timeout expires, the test step execution will be aborted and the test step will fail.

If set to 0, no timeout will be applied.

Tip: If you want to continue the test case execution when a test step fails, uncheck the Abort on Error option in the Test Case Options dialog.

Message

The last message that was received from the queue. This field is read-only.

Create/Edit AMQP Connection dialog

Use the Create AMQP Connection and Edit AMQP Connection dialogs to configure connections used by the test step. Both dialogs have the same set of options.

Note: ReadyAPI stores AMQP connections at the project level. This means that a connection defined for one test step can be used for all the test steps in other test cases and test suites of the project.
AMQP Testing in ReadyAPI: Create AMQP Connection dialog

Connection name

The unique name used to identify the connection.

Host

The AMQP server's host address.

Port

The port on the host through which the AMQP server is available.

User name

The username used to connect to the AMQP server. This field is optional.

Password

The user password used to connect to the AMQP server. This field is required if the username is specified.

Property list

You can also change the test step behavior by using the step properties on the AMQPReceiveTestStep Properties and Custom AMQP Receive Test Step Properties tabs.

Name Description
Name

The test step’s name.

Description

Text that describes the test step.

The values on the Custom AMQP Receive Test Step Properties tab are available to other test steps in your project. For instance, you can verify these property values with the Assertion test step, or you can check them and change the execution flow with the Conditional GoTo test step.

You can load the values of custom properties from a file or save them to a file. To learn more, see About Properties.

This tab contains the following properties that provide access to the request and response data:

Name Description
ackMessage

Specifies whether ReadyAPI will inform the broker that the message has been received. Possible values: true, false.

Note: Corresponds to the Acknowledge option specified in the test step editor.
queueName

Specifies the name of the queue from which a message will be fetched.

Note: Corresponds to the Queue option specified in the test step editor.
timeout

A timeout for the test step, in milliseconds. If no message is received within the specified time period, the test step execution will be aborted and the test step will fail. If this property is 0, it is ignored.

Note: Corresponds to the Timeout (ms) option specified in the test step editor.
messageBody

The body of the fetched message represented as a byte array.

Note: This property is read-only.
messageBodyAsString

The body of the fetched message represented as a string.

Note: This property is read-only.

Logging

If the test step is run as part of a test case, you can see the test log in the Transaction Log panel.

See Also

AMQP Testing
AMQP Declare Exchange
AMQP Declare Queue
AMQP Bind Queue
AMQP Receive
Test Steps

Highlight search results