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

Chapter 17. Changing Variable Values


Overview

When the Camel debugger hits a breakpoint, Variables view displays the values of all variables available at that point in the routing context. Some variables are editable, allowing you to change their value. This enables you to see how the application handles changes in program state.
Note
Not all variables are editable. The context menu of those that are displays the option, Change Value....

Procedure

To change the value of a variable:
  1. If necessary, start up the debugger. See Chapter 15, Starting the Camel Debugger.
  2. In Variables view, select a variable whose value you want to change, and then click its Value field.
    The variable's value field turns a lighter shade of blue, indicating it is in edit mode.
    Note
    Alternatively, you can right-click the variable to open its context menu, and select Change Value... to edit its value.
  3. Enter the new value and then click Enter.
    Console view displays an INFO level log entry noting the change in the variable's value (for example, Breakpoint at node to1 is updating message header on exchangeId: ID-dhcp-97-16-bos-redhat-com-52574-1417298894070-0-2 with header: Destination and value: ChangedTarget).
  4. Continue stepping through the breakpoints and check whether the message is processed as expected. At each step, check Debug view, Variables view, and the Console output.

Related topics

Chapter 19, Disabling Breakpoints in a Running Context
Chapter 18, Adding Variables to the Watch List
chapter "To Debug a Routing Context" in "Tooling Tutorials"
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.