Messages

Use message properties in your simulation file to define outgoing messages. Each message needs to contain all information that your service requires.

This topic lists all message properties and includes examples that show how to use them.

Message property

Description

Example

basedOn

Reference a message by its name.

Message 1

delay

Time in milliseconds that the simulation waits before it sends a response.

500

encoding

Sets the character encoding.

UTF-8

headers

Additional information that you send with the message, such as the content type. Define each header with a name and a value. To set a header with a dynamic value, use an insert rule with the type Header instead. For an example, check out Example - message with headers.

name: Content-Type

value: application/json

messagingProperties

Additional information that you send with the message. Only messaging technologies support this property, for example IBM MQ.

my property: 10

method

HTTP method that the message uses. Use GET, POST, PUT, DELETE, or PATCH.

PUT

name

Name of the message.

Message 2

payload

Content of the message. This is the data that two services exchange.

Text

payloadBase64

You can use this property as an alternative to payload if the payload contains special characters that YAML doesn't support. The value must be BASE64 encoded.

aGVsbG8gd29ybGQh

payloadFile

You can use this property as an alternative to payload if you want to send the payload in a separate file. The value must be a file path, either absolute or relative to the simulation file.

..\simulator\payload.txt

statusCode

HTTP status code of a response message. Enter the number, or the number and a description.

401 Unauthorized