검색

이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 26. Editing running routes

download PDF

Overview

You can experiment with changes to a running route without changing your project’s routing context.

To do so:

  • In the JMX Navigator view, enable the Edit Routes option on the running routing context.

    This opens an in-memory model of it — Remote CamelContext:<camelContextId> — in the route editor.

  • In the route editor, make your changes to the in-memory model of the routing context. At the same time, you can set breakpoints on relevant nodes to use the Camel debugger and all of its features.

    You can edit the in-memory model to add, remove, or rearrange nodes; to add or remove properties of existing nodes; and to modify property values set on existing nodes. You must save changes made to the in-memory model to update the running context and to see results in the Debug perspective if you set breakpoints.

  • In the JMX Navigator view, drop messages on the running routing context, or wait for messages to arrive from a timer, ActiveMQ, file, or other continuous input node.
  • In the Debug perspective, evaluate results and use the Camel debugger to gain deeper insight into your routing context.

Modifying a running route and evaluating results

  1. In the JMX Navigator view, select the routing context that contains the routes you want to edit.
  2. Right-click the selected routing context to open the context menu, and select Edit Routes.

    The route editor opens an in-memory model of the routing context, Remote CamelContext:<contextId>, and displays all routes in the context, for example:

    All Routes
    Note

    <contextId> is the ID of the camelContext element in the project’s routing context .xml file. In this example, which is based on the Fuse Content Based Router built-in template, the ID is cbr-example-context.

  3. Edit the route as described in Chapter 2, Editing a routing context in the route editor, then select File Save to save the changes you made to the in-memory model and to update the running routing context.
  4. Set breakpoints on the relevant nodes as described in Chapter 14, Setting Breakpoints.
  5. In the JMX Navigator view, drop a message on the running routing context’s input node.

    If your project does not include test messages, you can create them as described in Section 23.1, “Creating test messages for route tracing”.

  6. Click Yes to confirm the switch to the Debug perspective.
  7. In the Camel debugger, step the message through the breakpoints as you normally would (see Chapter 15, Running the Camel Debugger) to see the results your changes generated.

    The Camel debugger behaves the same in Edit Routes mode as in normal debug mode, so you can use any of the Camel debugger’s features while a message is transiting the routing context.

    Note

    When a message reaches the end of the routing context, the debugger is suspended. To continue debugging, switch back to the Fuse Integration perspective and drop another message on the input node in the JMX Navigator view. Each time you do so, the tooling asks you to confirm the switch to the Debug perspective.

    Note

    During a route editing session, it is possible to lose the connection to the running routing context. If this happens, then in the JMX Navigator view, you would see something like this: Local Processes maven[xxxx][Disconnected]. To continue the session, you must reconnect to the running routing context, select it in the JMX Navigator view, and then re-select Edit Routes.

Terminating the route editing session

  1. In the Debug perspective’s Debug view, select the Remote Camel Debug - camelContext--<contextId>--xxxxxxxxxxxxxxxxxx.xml [Remote Camel Context] thread, and then click Terminate button on the menu bar to terminate the debugging session.
  2. On Console view’s menu bar, click Terminate button to terminate the routing context.
  3. If you want to clear console output, click clear co on the Console view’s menu bar.
  4. Switch to the Fuse Integration perspective, and in the route editor, click close on the Remote CamelContext:<contextId> tab to close the in-memory model of the routing context file.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.