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 |
|
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 |
|
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 |
|
Enter the endpoint that receives your messages. This can be a URI, a port, or an IP address. |
https://www.send-messages.here.com/ |
|
|
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:
|
forward:
|
|
|
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:
|
forward: to: myConnection2
|
|
|
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 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 |
|
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 |
|
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 |
|
|
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 |
|---|---|---|
|
Use this property if the validateCertificate property is enabled. Enter the path to a collection of trusted certificates. |
/path/to/trust.jks |
|
|
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 |
|
|
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 |
This is an example of how a connection could look like:
-
The simulation contains two connection templates named myConnection01 and myConnection02.
-
The service named service01 refers to the connection template myConnection01 with the port property 8080.
schema: SimV1
name: my simulation
templates:
connections:
- name: myConnection01
port: 8080
- name: myConnection02
port: 8081
services:
- name: service01
steps:
- direction: In
connection:
basedOn: myConnection01