Congratulations! You have created a Designer Authoring instance with ingress enabled. When you are ready, navigate to the
next sectionto use this instance to test your switch server.
This section tests the Designer Authoring and switch server resources that you created in the previous scenarios. As a result, you gain a deeper understanding of how these resources can be configured and utilised.
There are four parts in this section. In
part 1, you create an API flow from the Designer Authoring UI. With the use of your switch server, this flow will establish a HTTP connection to your computer on port 1234. In order to establish the connection, you follow
part 2 to set up and start a secure agent on your computer. In addition, you use
part 3 to create and start a HTTP server on port 1234 to receive HTTP requests. Finally, you can test the API flow from the Designer Authoring UI in
part 4.
Part 1: Use the Designer Authoring UI to create an API flow
- Use the Designer Authoring URL (see scenario 2 step 4) to access the Designer Authoring UI. From the Designer Authoring UI, click Create flows for an API to create an API flow.
- From the top pane, rename the flow as testSwitchServer, and then specify the model name as invokeLocalApp. Finally, click Create model to create a model for the API flow.
- Add a property named responseMsg, and then click Operations to add an operation for the API flow.
- Click Select an operation to add, and then select Create invokeLocalApp.
- Click Implement flow to implement the API flow.
- Note that the Response node has an error, because the responseMsg property requires a value.
- Click the Response node to provide set a value, such as Hello!. When the flow is successfully invoked, this is be the response message that it issues.
- Click the blue circle between the Request and Response nodes to add an HTTP node to the flow. We will use the HTTP node to establish a connection to your computer. From the search pane under Applications & APIs, type http to locate the HTTP node, and then click Invoke method to configure it.
- Click Connect to create an account for the HTTP node.
- Click Maximize panel to show all configurable properties.
- Click to edit the Private network connection (optional) property, and set it to Private network agent for default. This uses your switch server to establish the HTTP connection.
- Edit the Override the HTTP endpoint host name and port of the URL used in the flow (optional) property, and set it to http://localhost:1234. Finally, click Connect.
- Edit the property called HTTP method, and set it to GET. Edit the property called URL (fully qualified), and set it to http://localhost:1234. Finally, click Done to create the flow.
- Click Start API to start the flow.
- The flow should be in the Running status.
Congratulations! You have created an API flow that will use the switch server resource to establish an HTTP connection to a local application. When you are ready, navigate to
part 2 to start a secure agent locally.
Part 2: Start a secure agent locally
- From the navigation pane in the Designer Authoring UI, click Connect, and then click Private networks.
- Click the options menu (⋮) for the Private network agent for defaults connection, and then click View setup instructions. This shows a set of instructions on how to configure a secure agent on your local computer.
- Expand 1. Download the secure agent, and then select an operating system under Select your operating system. This should be the operation system of your local computer. Finally, click Download the secure agent.
- Click Accept to download the agent.
- Expand 2. Download the secure agent configuration, and then click Download the configuration to download a configuration file for a switch client.
- From your local computer, carry out the following actions to start a secure agent:
- Copy both downloaded files into a folder named switchServer as shown in the following example:
- In a terminal, inside the switchServer folder, extract the secure agent file with the following command (substitute secureagent-x.tgz with your file name):
tar xvf secureagent-x.tgz
- Inside the switchServer folder, create a new folder named config with the following command:
mkdir config
- Move the switchclient.json file to the config folder with the following command:
mv switchclient.json config/
- The switchServer folder now contains files as shown in the following example:
- Open the switchclient.json file, and then set the value of endpoints.hostname to localhost. Finally, set the value of endpoints.port to 1234. Here is an example edited file:
Additional information:
- Notice that the JSON file contains a switch object (from line 21 in the example file), which contains information on the switch server instance that you created in scenario 1.
-
- The value of switch.url is the host of your switch server ingress.
- The value of switch.certs is the certificates of your cluster, where the Designer Authoring and switch server instances are created.
- Start the secure agent with the following command:
./secureagent -c config/switchclient.json -l . -d
Congratulations! You have started a secure agent locally. When you are ready, navigate to
part 3 to start an HTTP server locally.
Part 3: Start an HTTP server locally
The final component of your test setup is an HTTP server, which should run on your computer and listens on port 1234 to accept incoming HTTP requests. Such server can be established in many ways. Follow this tutorial to create a server written in the Go programming language.
- Copy the following Go template into a file, and save it as exampleApp.go
package main
import (
"log"
"net/http"
)
func main() {
helloHandler := func(w http.ResponseWriter, req *http.Request) {
log.Print("Hello world!")
}
http.HandleFunc("/", helloHandler)
log.Fatal(http.ListenAndServe(":1234", nil))
}
- In a new terminal, start the HTTP server with the following command:
go run sampleApp.go
Congratulations! You have started an HTTP server locally, listening on port 1234. When you are ready, navigate to
part 4 to test the API flow.
Part 4: Test the API flow from the Designer Authoring UI
- From the Designer Authoring UI, click the testSwitchServer tile.
- Click Test to invoke the flow.
- From the side pane, click POST/invokeLocalApp, and then click Try it.
- Click Generate to create test data for the request body, and then click Send to invoke the flow.
- You should receive a response code of 201, indicating a success. The response body should contain "responseMsg": "Hello!".
- From your local computer, inspect the terminal that hosts the HTTP server. You should see a message that contains Hello world!. Here is an example output:
2025/04/29 18:23:04 Hello world!
- From your local computer, inspect the terminal that hosts the secure agent. You should see a number of debug messages showing the agent has operated successfully. Here is an example output:
[2025-04-29T18:23:04.086+01:00] [DEBUG] AceWebSocket Received OP_ENDPOINT_OPEN header
[2025-04-29T18:23:04.089+01:00] [DEBUG] AceWebSocket Received OP_ENDPOINT_OPEN body
[2025-04-29T18:23:04.090+01:00] [DEBUG] AgentPReceiver OP_ENDPOINT_OPEN
[2025-04-29T18:23:04.092+01:00] [DEBUG] AgentPReceiver Endpoint found: {"name":"","hostname":"localhost","port":1234,"useTLS":false,"certs":{"key":"","cert":"","ca":[""],"rejectUnauthorized":true}}
[2025-04-29T18:23:04.094+01:00] [DEBUG] AgentPReceiver OP_ENDPOINT_SEND
[2025-04-29T18:23:04.100+01:00] [DEBUG] AgentPReceiver Connected to endpoint: {"name":"","hostname":"localhost","port":1234,"useTLS":false,"certs":{"key":"","cert":"","ca":[""],"rejectUnauthorized":true}}
[2025-04-29T18:23:04.101+01:00] [DEBUG] AceWebSocket Sending OP_ENDPOINT_CLOSE header. Endpoint ID: 1
[2025-04-29T18:23:04.102+01:00] [DEBUG] AceWebSocket Sending OP_ENDPOINT_CLOSE body. Length: 0 bytes
Conclusion
The IBM® App Connect Operator (version 12.11.0 or later) handles ingress for App Connect Designer Authoring and switch server instances on IKS. This means that you can access the App Connect Designer Authoring UI as soon as a Designer Authoring instance becomes ready. In addition, you can test switch servers out of box from such Designer Authoring instances.
If you want to upgrade your existing Designer Authoring and switch server instances to exploit this new feature, see the documentation on creating ingress for App Connect resources.