Este contenido no está disponible en el idioma seleccionado.

Chapter 25. Editing running routes


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:

    CanvasPalette
    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 13, 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 22.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 14, 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

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.