Connection Pool
A connection pool is a list of named ISO connections. You start them in Settings. Then Studio sends messages over them. Each connection stays open until you stop it.
Why you need it
To test a bank's issuing switch, PruTAN must act as the card scheme, for example Visa, Mastercard or RuPay. The issuing switch is the bank's system that approves or declines card payments. In real life, the bank's switch connects to the scheme. Then it waits for payments to approve or decline.
Before this feature, Studio could only connect out to a host. Now PruTAN can also listen on a port. The bank's switch connects in, and Studio sends payments over that connection.
Each pool connection works in one of two modes:
- Acceptor (Server): PruTAN listens on a port. The other side, for example the bank's issuing switch, connects in.
- Initiator (Client): PruTAN connects out to an IP address and port that you type.
Set up the pool
The pool belongs to the workspace that is selected in the header. Open Settings, scroll to Connection Configuration and find the Connection pool card. It is between ISO connections and IP whitelist.
Each row is one connection:
| Column | What it holds |
|---|---|
| Name | A name you choose, for example VISA Host Sim. Studio shows this name when you pick a connection. |
| IP address | Acceptor: the address of this machine. You cannot change it. Initiator: the IP address or host name to connect to. |
| Port | Acceptor: the port PruTAN listens on. Initiator: the port to connect to. |
| Mode | Acceptor or Initiator. Hold your mouse over the (i) next to Mode to see what each one means. |
| Status | The live state of the connection. Next to it is a button that starts or stops the connection. For an Acceptor, the button is Listen / Stop. For an Initiator, it is Connect / Disconnect. |
| Bin icon | Deletes the row. |
Add a connection
- Click + Add. A new row appears.
- Type a Name and choose the Mode.
- Fill in the Port. For an Initiator, also fill in the IP address.
- Click Save pool. This saves all rows together.
If a value is wrong, PruTAN shows the reason in red under the field. For example:
Already used by another row: another row already uses this name or port.Use a port from 8000 to 9000: the port is outside the allowed range.Enter a valid IP address or host name: the Initiator's address is not valid.
Acceptor (Server)
Use an Acceptor when the other side connects to PruTAN. For example, you act as the Visa host, and the bank's issuing switch connects to you. A row for that could be Name VISA Host Sim, Port 8601, Mode Acceptor.
- The IP address is the address of this machine. You cannot change it. Give this address and the port to the other side.
- The port must be in the range your installation allows. The Port box shows the range as a hint, for example
8000-9000. Your administrator sets the range withPORT_RANGE_FIRSTandPORT_RANGE_LAST. - Two Acceptors cannot use the same port. PruTAN also refuses a port that a Sandbox, an Interceptor or another workspace's pool already uses.
- Click Listen to start. The status shows Listening and how many clients are connected, for example
1 client connected. A client is a system that connected to this port. - Click Stop to stop listening.
- If more than one client is connected, Studio sends to the newest one.
Initiator (Client)
Use an Initiator when PruTAN connects to the other side. For example, Name Acquirer SUT (the system you are testing), IP address 10.20.14.31, Port 7001, Mode Initiator.
- Click Connect. PruTAN connects to the address and port.
- When the connection is up, the status shows Connected and the time it connected.
- While the connection is down, the status shows Connecting… and a retry count. PruTAN tries again every 5 seconds until you click Disconnect.
- Click Disconnect to close the connection and stop trying.
Start, stop and status
- Save a row before you start it.
- You cannot change or delete a running row. Stop it first.
- The play button at the top (Start all) starts every connection in the pool. The square button (Stop all) stops every connection.
- The top of the card shows how many connections are online and how many are offline. If some connections are still connecting, it shows how many. Next to the title is the size of the pool, for example
3 / 50. The default maximum is 50. - The status refreshes by itself every few seconds.
- Owners and editors can change the pool and start or stop connections. Viewers can only see the card.
Send over a pool connection
- Open an ISO request in Studio.
- Open the first dropdown in the request bar. It normally shows 8583. Choose Connection Pool.
- The host and port boxes disappear. A picker takes their place. Click the picker.
- Pick a connection from the list.
- Click Send.
The message goes over the open connection. The reply comes back on the same connection. The connection stays open after the reply.
The picker shows every connection in the pool, with its mode, its address and its state. The dot in front of each one shows whether you can send:
| Dot | Meaning |
|---|---|
| Green | The connection is up. You can send. |
| Yellow | An Initiator is still connecting, or an Acceptor is listening but nobody has connected yet. |
| Grey | The connection is offline. |
If Studio cannot send, hold your mouse over the picker to see why. Studio also shows the reason when you click Send.
Use a different connection in each environment
Pick From environment at the top of the list instead of a connection. Then the environment you select decides which connection the request uses. For example, the same request can go to Acquirer SUT Dev in Dev and to Acquirer SUT QA in QA. You do not change the request.
- In each environment, add a variable. Its value is the name of a connection. For example,
switch_conn=Acquirer SUT Devin Dev, andswitch_conn=Acquirer SUT QAin QA. - In the request bar, choose Connection Pool, open the picker and pick From environment.
- Type the variable in the box with its braces, as you do anywhere else. For example,
{{switch_conn}}. If you leave out the braces, PruTAN adds them. - Save the request.
The picker then shows the connection named in the selected environment. It shows the mode, the address and the state of that connection. To go back to a fixed connection, click the arrow on the right to open the list.
When you send, PruTAN reads the variable from the selected environment. If it is not there or is empty, PruTAN reads it from the Global environment. Upper and lower case do not matter in the connection name. The variable name must match exactly. This also works when you run a collection or a suite. Every request uses the environment you pick for the run.
Saving the request
When you save the request, PruTAN saves the name of the connection (or the variable, with From environment). If you later rename or delete that connection in Settings, the saved request still points at the old name. Open the request and pick a connection again.
Settings that still apply
The request's own settings still apply to the message: the spec, the header size, the end bytes and the request timeout. See Request Settings.
Two settings do not apply to pool connections:
- Keep the connection open (seconds), the workspace setting. A pool connection stays open until you click Stop or Disconnect.
- Send when idle for (s), the automatic echo.
How PruTAN finds the reply
Field 0 holds the message type, for example 0200 (a financial request). Field 11 holds the STAN (System Trace Audit Number). The STAN is a number that identifies one message.
The reply is the message that:
- answers the message type you sent, for example
0210for an0200, and - carries the same STAN as your request.
A late reply to an earlier message is skipped. So use a different STAN on each message. A function can make a new one for every send:
<field id="11" value="{{$generateRandomNumber(6)}}"/>Trace and History
For a run over a pool connection, Trace and History show Connection pool: followed by the name and address of the connection. When you open the run again from History, the same pool connection is picked. If the request used From environment, the run shows the connection that was used, not the variable.
When Send is refused
If the connection is not up, Studio does not send. It tells you why:
| Message | What to do |
|---|---|
Pick a connection from the pool | No connection is picked. Pick one in the picker. |
'VISA Host Sim' is offline - start it in Settings > Connection Configuration | Start the connection in Settings. |
Nobody is connected to 'VISA Host Sim' yet | The Acceptor is listening, but the other side has not connected. |
'Acquirer SUT' is still connecting | The Initiator is not connected yet. |
Pool connection 'VISA Host Sim' not found - pick another | The saved connection was renamed or deleted. Pick another one. |
Type the variable, e.g. {{switch_conn}} | From environment is picked, but the box is empty. |
QA has no switch_conn | The selected environment does not have the variable. Global does not have it either. Add it to the environment. |
No environment is selected and Global has no switch_conn | Select an environment that has the variable. |
No connection named 'Acquirer SUT QA' | The name in the environment is not a connection in the pool. Check the name. |
When you run a collection or a suite, PruTAN does the same checks as it sends each request. The message names the variable, for example Connection uses {{switch_conn}}, but the selected environment has no switch_conn - add it there or pick a connection.
0. An Initiator connected to it shows Connecting… for about 5 seconds after each send. To keep the connection open, set the Idle timeout (s) of that Sandbox collection to -1. See Create Sandbox.Limits
- Stress lab cannot use a pool connection. It refuses a request that uses one.
- PruTAN does not answer messages that the other side sends by itself. For example, the other side's echo test (
0800, a short message that checks the connection is still alive) gets no answer. - Pool connections do not use TLS (encryption on the connection).