Code Monkey home page Code Monkey logo

camel-dap-client-vscode's Introduction

Build and Test Maintainability Rating

VS Code Debug Adapter client for Apache Camel

A breakpoint hit on a Camel route endpoint and the variables displayed

How to use it

Happy path

  • Ensure jbang is available on system command-line
  • Open a Camel route which can be started with JBang
  • Call command Palette (Ctrl+Alt+P), and pick command Start Camel Application with JBang and debug or click on codelens Debug with JBang which appears on top of the file.
  • Wait that the route is started and debugger is connected
  • Put a breakpoint on the Camel route
  • Enjoy!

Happy path to start and debug Camel route

Advanced use cases

Use a Debug Launch configuration

  • Start a Camel 3.16+ application with camel-debug on the classpath
  • In .vscode/launch.json, provide this kind of content for a local default JMX connection (which is service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/camel):
  {
	"version": "0.2.0",
	"configurations": [
		{
			"type": "apache.camel",
			"request": "attach",
			"name": "Attach Camel Debugger"
		}
	]
  }
  • In Run and Debug panel, launch the Attach Camel Debugger
  • Put a breakpoint on the Camel route
  • Enjoy!

Configuration possibilities of the Debug Launch configuration

In .vscode/launch.json, provide this kind of content for a local default JMX connection (which is service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/camel):

  {
	"version": "0.2.0",
	"configurations": [
		{
			"type": "apache.camel",
			"request": "attach",
			"name": "Attach Camel Debugger"
		}
	]
  }

or for a specific JMX Url:

{
  "version": "0.2.0",
  "configurations": [
  	{
  		"type": "apache.camel",
  		"request": "attach",
  		"name": "Attach Camel Debugger",
  		"attach_jmx_url": "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/camel"
  	}
  ]
}

or for a local connection using PID of the Camel application process:

{
  "version": "0.2.0",
  "configurations": [
  	{
  		"type": "apache.camel",
  		"request": "attach",
  		"name": "Attach Camel Debugger",
  		"attach_pid": "857136"
  	}
  ]
}

Features

  • Support use of Camel debugger by attaching to a running Camel route written in Java, Yaml or XML (only Camel Main mode for XML) using the JMX Url
  • Support local use of Camel debugger by attaching to a running Camel route written in Java, Yaml or XML (only Camel Main mode for XML) using the PID
  • Support a single Camel context
  • Add/Remove breakpoint
  • Support conditional breakpoint with simple language. See here for details on how to write condition with simple language.
  • Inspect 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 values of variables:
    • in scope Debugger
    • the message body
    • a message header when it is of type String
    • an exchange property when it is of type String
  • Command Start Camel Application with JBang and debug. It allows a one-click start and Camel debug in simple cases. This command is available through:
    • Command Palette. It requires having a valid Camel file opened in editor.
    • Contextual menu in File explorer. It is visible to all *.xml, *.java, *.yaml and *.yml. It is up to the user to ensure it is a Camel route file. The command is also opening the files in editor to be ready to place breakpoints.
    • 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 and yaml files).
  • Configuration snippets for Camel debugger launch configuration
  • Configuration snippets to launch Camel application ready to accept a Camel debugger connection using JBang or Maven with Camel maven plugin or Quarkus Devs

Requirements

Java Runtime Environment 11+ with com.sun.tools.attach.VirtualMachine (available in most JVMs such as Hotspot and OpenJDK) must be available on system path.

For some features, JBang must be available on command-line.

The Camel instance to debug must follow these requirements:

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

Usage data

The Debug Adapter for Apache Camel by Red Hat extension collects anonymous usage data and sends it to Red Hat servers to help improve our products and services. Read our privacy statement to learn more. This extension respects the redhat.telemetry.enabled setting which you can learn more about at https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting

camel-dap-client-vscode's People

Contributors

dependabot[bot] avatar apupier avatar maxandersen avatar joshiraez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.