/camel-debug-adapter

Debug Adapter for Apache Camel based on Debug Adapter Protocol

Primary LanguageJavaApache License 2.0Apache-2.0

Build and Test License Zulip chat Maintainability Rating

Debug Adapter for Apache Camel

Debug Adapter for Apache Camel based on the Debug Adapter Protocol and Eclipse LSP4J as SDK.

The Debug Adapter allows to set breakpoints and debug Camel textual DSLs.

Requirements

The Camel instance to debug must follow these requirements:

  • Camel 3.15+
  • Have camel-debug on the classpath
  • Have JMX enabled

The Camel Debug Server Adapter must use Java Runtime Environment 11+ with com.sun.tools.attach.VirtualMachine (available in most JVMs such as Hotspot and OpenJDK).

Supported scope

  • Local only
  • Attach only
  • Camel DSLs:
    • Java DSL.
    • Yaml DSL. Note that the breakpoint must be set on the from/to line, not on the Camel URI line.
    • XML DSL in Camel Main mode. It implies that it is not working with Camel context specified in Camel XML file.
  • Single context
  • Add and remove breakpoint
  • Inspect some variables when breakpoint is hit
  • Stop on hit breakpoint
  • Resume a single route instance and resume all
  • Stepping when the route definition is in the same file
  • Specific client provided:

How to use it

  • java -jar camel-dap-server-xxx.jar
  • json parameter to provide on attach:
{
"attach_pid": "xxxxx",
"request": "attach"
}

Note that the request parameter is not part of the protocol but required by some clients (at least VS Code and Eclipse desktop).