AMQP Publish

Applies to ReadyAPI 3.52, last modified on April 18, 2024

About AMQP Publish test step

Use this test step to simulate actions of an AMQP publisher. The test step connects to an AMQP broker and posts a message to an exchange.

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 Publish test step

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

AMQP Testing: Publishing 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.

Exchange

The name of the exchange to which a message will be posted.

Routing key

The key that will be used to determine the queue to which the exchange will route the message.

Post to all queues

If the option is checked, the message will be posted to all the bound queues.

Expiration (ms)

The period, in milliseconds, after which the message will be removed from the queue. If set to 0, the message will be kept indefinitely.

Retained

If the option is checked, the message will survive broker restart. If the option is unchecked, the message will be deleted when the broker shuts down.

The fact that an exchange or a queue is durable does not make messages in them survive broker restart. If the messages are not flagged as retained, they will be lost.

Message type

The content type of the message.

Note: This parameter has no effect on how the AMQP broker will handle the message. Its value is up to interpretation by the application that will consume the message.

Message

The message that will be published on the exchange.

Note: All the above-mentioned fields support property expansions.

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 AMQPPublishTestStep Properties and Custom AMQP Publish 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 Publish 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 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
exchangeName

Specifies the name of the exchange.

Note: Corresponds to the Exchange option specified in the test step editor.
routingKey

Specifies the routing key.

Note: Corresponds to the Routing key option specified in the test step editor.
postToAllQueues

Specifies whether the message is posted to all the bound queues. Possible values: true, false.

Note: Corresponds to the Post to all queues option specified in the test step editor.
expirationTimeout

Specifies the period after which the message will be removed from the queue.

Note: Corresponds to the Expiration (ms) option specified in the test step editor.
retained

Specifies whether the message will survive broker restart. Possible values: true, false.

Note: Corresponds to the Retained option specified in the test step editor.
messageType

Specifies the content type of the message.

Note: Corresponds to the Message type option specified in the test step editor.
message

Specifies the contents of the message.

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

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