Connection properties

A connection is a virtual service endpoint. Use connection properties in your simulation file to mimic the connection to a service, for example timeouts, encryption, or authentication options. If the original service requires encryption, the virtual service needs to simulate a secure connection to behave the same way.

This topic lists the common connection properties and includes an example that shows how to use them.

Connection property

Description

Example

authentication

Specifies the authentication method for your connection. Supports the following values:

  • None means the service doesn't require authentication.

  • Basic requires a username and password to authenticate.

  • ClientCertificate uses a client certificate file for authentication.

  • Digest employs digest access authentication, which securely transmits credentials using hashing.

None

basedOn

Reference a connection by its name.

Connection 1

capture

Set this property to true to temporarily store all sent or received messages. The default value is false.

true

clientCertificateFile

Define this property if you need Secure Sockets Layer (SSL) authentication for a connection. Enter the path to the client certificate file.

/path/to/clientcert.pem

clientCertificatePassword

Use this property if the client certificate file requires a password.

test123

endpoint

Enter the endpoint that receives your messages. This can be a URI, a port, or an IP address.

https://www.send-messages.here.com/

forward

Define a connection to which you want to forward all incoming messages. Always specify forward in combination with the properties to, mode and, if needed, simulateOn:

  • to: Specify the name of the connection. You must define the referenced connection in the same simulation file or another simulation file in the same workspace folder.

  • mode: Use this property to define what type of connection it is. The following options are available:

    • passThrough: The message is forwarded to the real service.

    • simulate first: The message is sent to a simulation. If the simulation doesn't work, it's forwarded to the real service.

    • forward first: The message is sent to the real service first. If the service isn't available, it's forwarded to the simulation.
      In addition, you need the property simulateOn to specify when the simulation should be triggered.

    • learning: It works like forward first and also learns the new behavior from the real service.

  • simulateOn: You need this property only in combination with the property forward first. This lets API simulation know when to trigger the simulation.

    • timeout: Specify how long API simulation should wait for the service to respond before the fallback service starts. Enter the time in milliseconds.

    • statusCode: You can enter multiple status codes, separated by comma.

forward:
to: myConnection2
mode: passThrough

 

 

learning

When you use forwarding with learning mode, your messages first go to the simulation. If the simulation doesn’t respond, API simulation forwards the request to the real service. At the same time, it records the real service’s response and saves it as a new simulation file. This allows the simulation to handle the same request in the future.

When API simulation creates the simulation file, it detects possible trigger elements and saves them as trigger properties.

Optionally, you can use the following properties with learning: 

  • With the sort property you can keep your simulations organized. Select one of the following sorting options:

    • ByConnection: It sorts simulations by connection name into folders, which makes it easier to track messages from specific systems or endpoints.

    • ByPath: It sorts simulations by the incoming message’s path, creating a folder structure that mirrors the API or message logic.

    • ByTimestamp: Each simulation uses a timestamp-based file name and it's stored in the workspace folder for easy identification and chronological tracing.

  • externalPayload: When set to true, the Simulator agent stores learned message payloads in separate simulation files instead of embedding them in the current file. This keeps the simulation file clean.

  • learnOn: You can specify rules that must be met before learning mode begins. For example, you can limit learning to specific messages by checking headers, properties, or payload values.

  • pathTemplate: You can specify the file name or folder path where the learned simulation files will be stored. This allows you to organize simulation files, for example, by endpoint, connection, or use case. If a file already exists, new services are simply added to it.

  • The patterns property lets you define additional message details, such as JSON fields, which learning mode uses to tell services or scenarios apart. Rather than grouping all requests by only the URI and HTTP method, you can categorize them by values such as user roles or operation types. This allows you to create different behaviors for different use cases.

forward:

to: myConnection2
mode: learning
sort: ByConnection

 

car service example

keepProcessed

Determines whether the connection keeps or deletes processed messages. Set the value to true to keep them. The default value is false.

true

listen

The default value is true, which means that the connection sends and receives messages. To make the connection only send messages, set the value to false.

true

name

Name of the connection.

myConnection

password

Use this property if authentication is required.

test123

port

Port that the connection uses to listen for incoming messages.

8080

queue

Use this property if you read or write messages through a message broker queue. Enter the name of the queue.

myQueue

selector

Use this property with message broker queues to filter the messages that you receive from the queue. Only messages that contain the specified value pass through. The syntax and support of selector depend on your message broker.

JMSPriority = 9

serverCertificateFile

To encrypt the connection, enter the path to the certificate.

/etc/certs/server.pfx

serverCertificatePassword

Use this property if the connection requires encryption and a password for the provided server certificate file.

test123

serverCertificateThumbprint

Enter the thumbprint of the certificate if the connection must be encrypted. When it opens a connection, API simulation uses the thumbprint to search for the certificate in the certificate stores of the operating system.

a909502dd...

topic

Use this property if you read or write messages through a message broker topic. Enter the name of the topic.

myTopic

type

Specify this property to use a connection technology other than the default HTTP. For instance, to send or receive messages via message broker or to connect to a folder. Valid values are AmazonSqs, Amqp, AzureSb, Folder, Http, IbmMq, Kafka, RabbitMQ, Solace and Custom.

For the Custom connection type, specify the typeName property to identify the custom connection.

RabbitMQ

typeName

If you use a Custom connection type, enter a name to identify the connection.

myCustomConnection

uri

Enter the URI that receives the messages.

www.tricentis.com

username

Use this property if authentication is required.

myUser

Use these connection properties to define a specific file directory on your local machine or a network drive:

Connection property

Description

Example

create

Determines whether the connection creates the folder in the file system if it doesn't exist. The default value is false.

true

fileExtension

Enter the file extension.

xml

folder

Specify the path to a folder that API simulation will check for new messages. The type property of the connection must be set to folder.

/path/to/messages

These are the Amazon MQ broker connection properties that you can use:

Connection property

Description

Example

accessKey

Enter your Amazon SQS access key ID.

your_access_key_id

account

Enter the name of your Amazon Web Services account.

myAccount

region

Some operations require a region. For the best network performance, select a region near you.

us-east-1

secretKey

Enter your Amazon SQS secret access key.

your_secret_access_key

These are the Apache Kafka broker connection properties that you can use:

Connection property

Description

Example

clientPropertiesFile

Enter the path to the file that contains your Kafka connection settings.

/path/to/kafka.properties

groupId

Enter the ID of the group.

myGroup

partition

Enter the number of the partition.

1

These are the Azure Service Bus broker connection properties that you can use:

Connection property

Description

Example

accessKey

Enter your Azure Service Bus access key to connect to an Azure Service Bus.

your_access_key

accessKeyName

Enter your Azure Service Bus access key name.

RootManageSharedAccessKey

These are the IBM MQ broker connection properties that you can use:

Connection property

Description

Example

channel

Enter the name of the channel that communicates with the message broker.

CH1

CipherSpec

Enter the combination of encryption algorithm and message authentication code algorithm to enable SSL encrypted communication.

ECDHE_ECDSA_3DES_EDE_CBC_SHA256

CipherSuite

Enter your suite of cryptographic algorithms. Cipher Suite is an alternative way to select a spec to enable SSL encrypted communication.

SSL_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA

KeyRepository

Enter the file path to your key repository without file extension to enable SSL encrypted communication.

C:\Data\ssl_certificate

manager

Enter the name of the IBM MQ queue manager that communicates with the message broker.

myManager

peerName

Use this property to verify the Distinguished Name (DN) of the certificate from the peer queue manager.

QMGR

These are the RabbitMQ broker connection properties that you can use:

Connection property

Description

Example

exchange

Enter the name of the exchange that routes the messages to different queues.

myExchange

routingKey

Enter the routing key if the broker requires it.

myRoutingKey

virtualHost

Enter the name of the virtual host.

myVirtualHost

These are the Solace broker connection properties that you can use:

Connection property

Description

Example

trustStorePath

Use this property if the validateCertificate property is enabled. Enter the path to a collection of trusted certificates.

/path/to/trust.jks

validateCertificate

Determines whether to trust the certificates defined in the trust store. The default value is false. To trust the certificates, set the value to true. If this property is enabled, you must define the trustStorePath property.

true

privateKeyFile

If you use a client certificate file, you must define this property. Enter the path to the client certificate key file.

/path/to/clientkey.pem

privateKeyFilePassword

If a private key file is password protected, use this property.

myPass

vpnName

Enter the name of the message VPN to join.

myVPN