Skip to content

Debugging the Runtime

Kurt T Stam edited this page Aug 23, 2019 · 1 revision

In this scenario you want to debug the runtime (a running integration). There are two ways to do this.

The Hard Way: Attach a debugger to an integration pod

Start the pod in debug mode.

Edit the ReplicationController of the Integration you want to debug

oc edit rc <rc-integration-name>

and add the JAVA_DEBUG flag

...
    spec:
      containers:
      - env:
        - name: LOADER_HOME
          value: ${JAVA_DATA_DIR}/syndesis/loader
        - name: JAVA_DEBUG
          value: "true"
...

You will need need to restart the integration pod, so that the pod starts with JAVA_DEBUG=true.

Attach the debugger

At this point you can use

oc port-forward <pod-name> 5005

and you can attach a debugger to localhost:5005 from you favorite IDE.

To update code in a connector you will need to run

man clean install

in the connector project, then rebuild the s2i image

tools/bin/syndesis build -m s2i -c -f -i

and finally you will need to rebuild your integration (using the syndesis console)

The Easy Way: Start the integration java process on your local machine.

Export a running integration

In your syndesis git project use

tools/misc/extract_integration.sh <podname> <myproject>

where podname is the name of the running pod and myproject is a directory where it will export the project code. After extraction you can import this project into your IDE. You can start the process by running the Application class in the project. If your project need a connection to the SampleDB you can port-forward this to your localhost using

oc port-forward <db-pod-name> 5432

Updating code

You can now simply change code in your connector project and your IDE will pick it up.