Virtual Services (beta)

« Back to documentation home

Architecture

  • Each Traffic Parrot server can host one or more virtual services
  • Each virtual service has a separate configuration directory on the filesystem
  • HTTP virtual services can be run on multiple ports
Traffic Parrot Virtual Services Directories Architecture Diagram
Traffic Parrot Virtual Services Multiple HTTP Ports Architecture Diagram
Traffic Parrot Virtual Services Home

Managing Virtual Services

The virtual services can be managed using the Virtual Services UI page:

Traffic Parrot Virtual Services List
Add Virtual Service
To add a virtual service, click the new virtual service button:
Traffic Parrot New Virtual Service Button
Which will show a create dialog:
Traffic Parrot New Virtual Service Dialog

Click the submit button to create the virtual service. If a valid free HTTP/HTTPS port is specified, then the virtual service will be accessible on the ports specified.

Edit Virtual Service
To edit a virtual service, click the edit virtual service button for an existing virtual service in the list:
Traffic Parrot Edit Virtual Service Button
Traffic Parrot Edit Virtual Service Dialog

Click the submit button to edit the virtual service. If a valid free HTTP/HTTPS port is specified, then the virtual service will be accessible on those ports. The service will no longer be accessible on the old ports.

Delete Virtual Service
To delete a virtual service, click the delete virtual service button for an existing virtual service in the list:
Traffic Parrot Delete Virtual Service Button
Traffic Parrot Delete Virtual Service Dialog

Click the delete button to delete the virtual service. The service will no longer be accessible on the old port. The deleted virtual service mappings will be backed up in the deleted-scenarios directory.

Select Virtual Service
To select a virtual service, click on the name of the virtual service in the dropdown at the top of the page. This can be accessed from any page.
Traffic Parrot Select Virtual Service

Once selected, the following will happen:

  • The default HTTP virtual service port of 8080 will serve the selected virtual service over HTTP
  • The default HTTPS virtual service port of 8081 will serve the selected virtual service over HTTPS
  • The custom HTTP/HTTPS ports assigned to each virtual service remain active regardless of the currently selected virtual service
  • The Add/Edit/Record/Replay pages for all protocols now impact the currently selected virtual service
Advanced Configuration
Each virtual service has a service.properties file that can be used to specify advanced configuration such as custom HTTPS certificates:
Property name Description Example usage
http.port The HTTP port for the virtual service http.port=9017
https.port The HTTPS port for the virtual service https.port=9018
https.key.store.path Path to the HTTPS key store to use https.key.store.path=certs/server.jks
https.key.store.password The password for the HTTPS key store https.key.store.password=password
https.key.manager.password The password for the HTTPS key store manager https.key.manager.password=password
https.key.store.type The type of key store used, for example JKS or PKCS12 https.key.store.type=JKS
https.need.client.auth Whether client authentication is required. Set to true or false. https.need.client.auth=true
https.trust.store.path Path to the HTTPS trust store to use https.trust.store.path=certs/servertrust.jks
https.trust.store.password The password for the HTTPS trust store https.trust.store.password=password
https.trust.store.type The type of trust store used, for example JKS or PKCS12 https.trust.store.type=JKS

Limitations

  • The UI can only be used to make changes to one virtual service at a time
  • Live changes to virtual services names and ports are only picked up if the changes are made via the UI (changes directly to the filesystem of a running instance are not picked up dynamically)
  • Only one JMS/MQ/Files/gRPC virtual service can be set to record or replay mode at a time
  • Switching virtual service while replay mode is active for JMS/MQ/Files is not supported and replay must be stopped before switching