Este conteúdo não está disponível no idioma selecionado.
Chapter 4. Debug support for Camel
The VS Code extensions for Apache Camel are listed as development support. For more information about scope of development support, see Development Support Scope of Coverage for Red Hat Build of Apache Camel.
4.1. Debug Adapter for Apache Camel routes Copiar o linkLink copiado para a área de transferência!
The VS Code Debug Adapter is a Visual Studio Code extension that you can use to debug running Camel routes written in Java, Yaml or XML DSL.
4.1.1. Features of Debug Adapter Copiar o linkLink copiado para a área de transferência!
The VS Code Debug Adapter for Apache Camel extension supports the following features:
- Camel Main mode for XML only.
- The use of Camel debugger by attaching it to a running Camel route written in Java, Yaml or XML using the JMX url.
- The local use of Camel debugger by attaching it to a running Camel route written in Java, Yaml or XML using the PID.
- You can use it for a single Camel context.
- Add or remove the breakpoints.
- The conditional breakpoints with simple language.
- Inspecting the variable values on suspended breakpoints.
- Resume a single route instance and resume all route instances.
- Stepping when the route definition is in the same file.
- Allow to update variables in scope Debugger, in the message body, in a message header of type String, and an exchange property of type String
Supports the command
Run Camel Application with JBang and Debug.This command allows a one-click start and Camel debug in simple cases. This command is available through:
- Command Palette. It requires a valid Camel file opened in the current editor.
-
Contextual menu in File explorer. It is visible to all
*.xml,*.java,*.yamland*.yml. -
Codelens at the top of a Camel file (the heuristic for the codelens is checking that there is a from and a to or a log on
java,xml, andyamlfiles).
Supports the command
Run Camel application with JBang.- It requires a valid Camel file defined in Yaml DSL (.yaml|.yml) opened in editor.
- Configuration snippets for Camel debugger launch configuration
- Configuration snippets to launch a Camel application ready to accept a Camel debugger connection using JBang, or Maven with Camel maven plugin
4.1.2. Requirements Copiar o linkLink copiado para a área de transferência!
The following points must be considered when using the VS Code Debug Adapter for Apache Camel extension:
Prerequsites
Java Runtime Environment:
- 17 or later
-
com.sun.tools.attach.VirtualMachineinstalled.
The Camel instance:
- Camel version 3.16 or later
-
camel-debugin the classpath. -
JMXenabled.
For some features, JBang must be available in the CLI environment.
4.1.3. Installing VS Code Debug Adapter for Apache Camel Copiar o linkLink copiado para a área de transferência!
You can download the VS Code Debug Adapter for Apache Camel extension from the VS Code Extension Marketplace and the Open VSX Registry. You can also install the Debug Adapter for Apache Camel extension directly in the Microsoft VS Code.
Procedure
- Open the VS Code editor.
- In the VS Code editor, select View > Extensions.
- In the search bar, type Camel Debug. Select the Debug Adapter for Apache Camel option from the search results and then click Install.
This installs the Debug Adapter for Apache Camel in the VS Code editor.
4.2. Using VSCode Debug Adapter for Apache Camel with standalone Camel routes Copiar o linkLink copiado para a área de transferência!
You can debug your camel application with the debug adapter.
Procedure
-
Ensure that the
jbangbinary is available on the system commandline. - Open a Camel route which can be started with Camel CLI.
-
Call the command Palette using the keys
Ctrl + Shift + P, and select the Run Camel Application with JBang and Debug command or click on the codelens Camel Debug with JBang that appears on top of the file. - Wait until the route is started and debugger is connected.
- Put a breakpoint on the Camel route.
- Debug.
Additional resources
4.3. Using VSCode Debug Adapter for Apache Camel with Quarkus Copiar o linkLink copiado para a área de transferência!
You can debug your camel application with the debug adapter.
Procedure
-
Ensure that the
jbangbinary is available on the system commandline. - Open a Camel route which can be started with Camel CLI.
-
Call the command Palette using the keys
Ctrl + Shift + P, and select the Run Camel Application with JBang and Debug command or click on the codelens Camel Debug with JBang that appears on top of the file. - Wait until the route is started and debugger is connected.
- Put a breakpoint on the Camel route.
- Debug.
4.4. Using VSCode Debug Adapter for Apache Camel with Spring Boot Copiar o linkLink copiado para a área de transferência!
You can debug your camel application with the debug adapter.
Procedure
-
Ensure that the
jbangbinary is available on the system commandline. - Open a Camel route which can be started with Camel CLI.
-
Call the command Palette using the keys
Ctrl + Shift + P, and select the Run Camel Application with JBang and Debug command or click on the codelens Camel Debug with JBang that appears on top of the file. - Wait until the route is started and debugger is connected.
- Put a breakpoint on the Camel route.
- Debug.
Additional resources