Chapter 14. Setting Breakpoints


Overview

You can set breakpoints in either JBoss perspective or in Fuse Integration perspective, but JBoss perspective provides more room for expanding the route editor's canvas when building and modifying routes. To set breakpoints, your project's routing context .xml file must be open in the route editor's Design View.
The Camel debugger supports two types of breakpoints:
  • Unconditional breakpoints—triggered whenever one is encountered during a debugging session
  • Conditional breakpoints—triggered only when the breakpoint's specified condition is met during a debugging session
Note
You cannot set breakpoints on Consumer endpoints or on When or Otherwise nodes.
Note
The Camel debugger requires the camelContext element and each node for which a breakpoint is set to have a unique ID. You can set IDs manually in a node's Properties editor or directly in the CamelContext file in Source view, or you can let Fuse Tooling generate and apply them automatically. The Please confirm... dialog opens whenever you set a breakpoint on a node that does not already have a unique ID.
Important
Make sure you save any changes you make to your routing context file before you run the Camel debugger on it. Otherwise, your changes will not be included in the debugging session.

Setting unconditional breakpoints

With your routing context displayed on the canvas in Design View:
  1. Select a node whose state you want to examine during the debugging session.
  2. Click its icon to set an unconditional breakpoint.
  3. In the Please Confirm... dialog, click OK to have the Route Editor automatically generate and apply a unique ID to the <camelContext> element and to the node or nodes that need it, or click Cancel if you want to manually enter unique IDs in the <camelContext> element and to each node that needs one.
  4. Repeat these steps for each node on which you want to set an unconditional breakpoint.

Setting conditional breakpoints

With your routing context displayed on the canvas in Design View:
  1. Select a node whose state you want to examine during the debugging session.
  2. Click its icon to set a conditional breakpoint and open the Edit the condition and language of your breakpoint... dialog.
  3. Click the Language drop-down menu and select the expression langauge to use to create the condition that will trigger the breakpoint.
    Fuse Tooling supports twenty expression languages from which to choose. Except for constant, method, property, and ref, each of these languages provides variables for creating conditional expressions.
  4. Click the Variables drop-down menu and select in sequence one or more of the language's supported variables to create the condition for triggering the breakpoint. The variables you select appear in the Condition text box.
    Alternatively, you can manually enter the expression directly into the Condition text box.
  5. Repeat steps Step 1 through Step 4 for each node on which you want to set a conditioanl breakpoint.

Disabling breakpoints

You can temporarily disable a breakpoint, leaving it in place, then enable it again later. The button skips over disabled breakpoints during debugging sessions.
To disable a breakpoint, select the node on the canvas and click its icon. The breakpoint turns gray, indicating it has been disabled.
To enable a disabled breakpoint, select the node on the canvas and click its icon. Depending on whether the disabled breakpoint is conditional or unconditional, it turns yellow or red, respectively, to indicate it has been re-enabled.
Note
You can also disable and re-enable breakpoints during debugging sessions. For details, see Chapter 19, Disabling Breakpoints in a Running Context.

Deleting breakpoints

You can delete individual breakpoints or all breakpoints.
  • Individual breakpoints—on the canvas, select the node whose breakpoint you want to delete, and click its icon.
  • All breakpoints—right-click the canvas, and select Delete all breakpoints.

Related topics

Chapter 15, Starting the Camel Debugger
chapter "To Debug a Routing Context" in "Tooling Tutorials"
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.