Virtual Services (using multiple ports)
Traffic Parrot supports multiple virtual services in one Traffic Parrot instance.
For example, when implementing HTTP virtual services you can run each of them on separate ports.
Currently the following protocols fully support the virtual services feature:
- Native IBM® MQ
Limited support is provided for the following protocols, as per the existing scenarios feature
- Each Traffic Parrot server can host one or more virtual services
Each virtual service has a separate configuration directory on the filesystem, including:
- HTTP virtual services can be run on multiple ports
- MQ virtual services can connect to multiple queue managers
Managing Virtual Services
The virtual services can be managed using the Virtual Services UI page:
Add Virtual Service
To add a virtual service, click the new virtual service button:
Which will show a create 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:
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:
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.
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
Virtual Service Properties
Each virtual service has a service.properties
file that is used to
specify configuration such as custom HTTPS certificates and MQ startup settings:
||The HTTP port for the virtual service
||The HTTPS port for the virtual service
||Path to the HTTPS key store to use, relative to the virtual service directory
||The password for the HTTPS key store
||The password for the HTTPS key store manager
||The type of key store used, for example JKS or PKCS12
||Whether client authentication is required. Set to true or false.
||Path to the HTTPS trust store to use, relative to the virtual service directory
||The password for the HTTPS trust store
||The type of trust store used, for example JKS or PKCS12
||When set to true, replay mode will be enabled for this virtual service ibm-mq-mappings on startup
||The name of the queue manager to connect to consume request messages, as specified in ibm-mq-connections.json
||The name of the queue manager to connect to produce response messages, as specified in ibm-mq-connections.json
Virtual Service Configuration
To configure a HTTPS virtual service you should:
- Follow the instructions to configure a HTTP virtual service and specify a HTTPS port
(optional) Configure HTTPS configuration in the scenarios/ServiceName/service.properties file:
- The UI can only be used to make changes to one virtual service at a time
The UI does not support editing the following configuration, which must be
configured directly using the file system and a text editor:
- 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/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/Files is not supported and replay must be stopped before switching
Old version warning!
This documentation is for an old version of Traffic Parrot. There is a more recent Traffic Parrot version available for download at trafficparrot.com
Browse documentation for recent version