搜索

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

Chapter 18. Changing Variable Values

download PDF

Overview

When the Camel debugger hits a breakpoint, the 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 editable variables displays the Change Value…​ option.

Procedure

To change the value of a variable:

  1. If necessary, start the debugger. See Chapter 16, Running the Camel Debugger.
  2. In the Variables view, select a variable whose value you want to change, and then click its Value field.

    editBPvars1

    The variable’s value field turns a lighter shade of blue, indicating that 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.

    The 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: UNITED KINGDOM).

  4. Continue stepping through the breakpoints and check whether the message is processed as expected. At each step, check the Debug view, the Variables view, and the Console output.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.