此内容没有您所选择的语言版本。

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

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.