Using your developer tools to resolve issues in the connector code
As a developer, you can resolve any issues in your connector code. After you develop your connector and generate the connector code, start the connector. When you start the connector, it creates a Docker container on the system where the BMC Helix Connector Designer is installed and starts the connector in debug mode. A port ID is assigned that can be helpful in debugging the connector. You can debug the code from a local system or a remote system, but you must create a local copy of the code on the system that you are working on.
Important
To debug the code, for NodeJS-based connectors, use VS Code and for Java-based connectors, use a tool such as IntelliJ.
To debug your connector code
- On the docker instance, to verify that the container has been created with the assigned port ID, run the
docker ps
command.
The parameters required to copy this code and set the run configuration files are also displayed. - On your local system, run the following command to copy the /panama folder from the docker container to your local system. The code copied includes two directories: connectorName and connectors.
docker cp <containerID:connectorPathinContainer> <nameofFolderonLocalSystem>. Perform one of the following actions:If you are running the debugger on a local system, copy it to your system.
- If you are running the debugger on a remote system, create a local copy on the remote system.
To debug the copied code, add a run configuration file:
- For a java-based connector, to create a run configuration perform the following steps in IntelliJ:
- To open the Run/Debug configuration from the main menu, select Run > Edit Configuration.
To add a new configuration, click +and enter the following values:
Configuration Value Port
Enter the port ID provided when you click Start. This is the port ID on which the connector is running. Host Enter the IP address of the system on which the container is installed. Use module classpath Select the folder where you copied the code from the container. Apply the changes and click OK.
For a NodeJS-based connector, to create a launch.json file perform the following steps in VS Code:
Open the copied connector project.
In the Run view, from the top menu bar, click
.
VS Code creates a .vscode folder and adds launch.json file to your workspace.Open the launch.json file, and update the following values:
Configuration Value Port
Enter the port ID provided when you click Start. This is the port ID on which the connector is running. Address Enter the IP address of the system on which the container is installed. localRoot Enter the location of the Workspace folder where you copied the connector files from the container. Save your configuration.
- For a java-based connector, to create a run configuration perform the following steps in IntelliJ:
To start debugging your connector code, click the Debug option.
Important
To view accurate logs for your container, create and run a flow to execute all the configurations defined for your container.
To verify that the local system is connected to the docker container:
- In VS Code, ensure that the loaded scripts are displayed in the console when you click Debug.
Make sure you see the connectorName folder under the /opt/panama/ folder. - In the IntelliJ console, the following confirmation message is displayed:
Connected to the target VM, address: <ipAddress>, transport, socket
Also, make sure that the Frames section displays the connector configurations.
- In VS Code, ensure that the loaded scripts are displayed in the console when you click Debug.
If the connection is unsuccessful, verify that the details entered in the Run Configuration files match the values of the docker container.
Related topic
Setting up your developer tools for remote hosting of the connector code
Comments
Log in or register to comment.